build-system: go: Properly handle when a target is unsupported.

* guix/build-system/go.scm (go-target): Properly handle when a target is
unsupported.

Change-Id: Ibc0becb8eb0a712d21116112c44e2bbbb707ddf4
This commit is contained in:
Christopher Baines 2024-07-05 15:45:25 +02:00
parent 67b212ff60
commit 32eda73966
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577

View file

@ -33,6 +33,8 @@ (define-module (guix build-system go)
#:use-module (ice-9 match)
#:use-module (ice-9 regex)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-34)
#:use-module (srfi srfi-35)
#:export (%go-build-system-modules
go-build
go-build-system
@ -101,7 +103,13 @@ (define (go-target target)
(_ arch))
(match os
((or "mingw32" "cygwin") "windows")
(_ os))))))
(_ os))))
(_
(raise
(condition
(&unsupported-cross-compilation-target-error
(build-system go-build-system)
(target target)))))))
(define %go-build-system-modules
;; Build-side modules imported and used by default.