cmd/go: inferred GOAMD64 value in go env should be applied to build #73294
Labels
arch-amd64
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
go version go1.24.1 freebsd/amd64
Output of
go env
in your module/workspace:What did you do?
Example program:
go.mod
:main.go
Observe the architecture feature
GOAMD64='v3'
ingo env
and the buildconstraint//go:build amd64.v3
inmain.go
. Now try to build the example program withgo build
.What did you see happen?
$ go build package example: build constraints exclude all Go files in /tmp/example
What did you expect to see?
A successfully build example program
main
.The feature has to be given explicitly to satisfy the constraint:
The text was updated successfully, but these errors were encountered: