1 env GOARCH=amd64
2 env GOAMD64=
3 go env GOAMD64
4
5 # Check that the default doesn't match.
6 # For the purposes of this test, we use v99 which should
7 # never match any real systems for quite a few years.
8 ! go list -f '{{ range $f := .GoFiles }}{{ $f }}{{ end }}'
9 ! go build
10
11 # settable from the environment
12 env GOAMD64=v99
13 go list -f '{{ range $f := .GoFiles }}{{ $f }}{{ end }}'
14 stdout main.go
15 go build
16
17 # settable from the config file
18 env GOAMD64=
19 env GOENV=$WORK/env
20 go env -w GOAMD64=v99
21 go list -f '{{ range $f := .GoFiles }}{{ $f }}{{ end }}'
22 stdout main.go
23 go build
24
25 -- go.mod --
26 module test
27
28 -- main.go --
29 //go:build amd64.v99
30
31 package main
32
33 func main() {}
34
View as plain text