The test fail when $GOROOT/go.env contain GOTOOLCHAIN=local
because GOTOOLCHAIN=local is assumed to be a non-default value.
This CL fixed the test failure
by using go.env from the test as $GOROOT/go.env throughout the test.
Test have also been added to ensure that
when $GOROOT/go.env contain GOTOOLCHAIN=local,
GOTOOLCHAIN=local is not taken as a non-default value.
Fixes #67793
Change-Id: Ibc5057d38d36c6c55726a039de1e7c37d6935b52
GitHub-Last-Rev:
12b62464e671021320c54e251dfb1ebcb5925096
GitHub-Pull-Request: golang/go#67807
Reviewed-on: https://go-review.googlesource.com/c/go/+/590196
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
# Test query for non-defaults in the env
+env GOROOT=./a
env GOTOOLCHAIN=local
env GOSUMDB=nodefault
env GOPROXY=nodefault
[GOARCH:amd64] stdout '"GOARCH": "arm64"'
[!GOARCH:amd64] stdout '"GOARCH": "amd64"'
-env GOROOT=./a
env GOPROXY=s
go env -changed GOPROXY
! stdout 'GOPROXY'
go env -changed GOPROXY
stdout 'GOPROXY=''?s2''?'
+env GOROOT=./b
+go env -changed
+! stdout 'GOTOOLCHAIN=''?local''?'
+
-- a/go.env --
GOPROXY=s
+
+-- b/go.env --
+GOTOOLCHAIN=local