Skip to content

Commit

Permalink
internal/buildcfg: fix test for GOAMD64=v3 ./all.bash
Browse files Browse the repository at this point in the history
If GOAMD64 is set to a bogus value, goamd64() will return the default
value, which may not necessarily be 1. Instead, just test that it sets
Error.

Change-Id: Ibbc26608c1ae24e645c7753ef5765b9c2fdc089e
Reviewed-on: https://go-review.googlesource.com/c/go/+/351129
Trust: Matthew Dempsky <[email protected]>
Run-TryBot: Matthew Dempsky <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
mdempsky committed Sep 20, 2021
1 parent ba1c52d commit d7e3e44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/internal/buildcfg/cfg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ func TestConfigFlags(t *testing.T) {
if goamd64() != 4 {
t.Errorf("Wrong parsing of GOAMD64=v4")
}
Error = nil
os.Setenv("GOAMD64", "1")
if goamd64() != 1 {
if goamd64(); Error == nil {
t.Errorf("Wrong parsing of GOAMD64=1")
}
}

0 comments on commit d7e3e44

Please sign in to comment.