cmd/go: fix TestScript/gotoolchain_net when $PATH contains golang.org/dl/go1.20.1

For #57001.

Change-Id: Idcc291c872864bcce7e6d411cdd208db3b331282
Reviewed-on: https://go-review.googlesource.com/c/go/+/499855
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Bypass: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Bryan C. Mills 2023-06-01 10:13:11 -04:00 committed by Gopher Robot
parent 5f695f7072
commit 5f08963b2c
1 changed files with 9 additions and 0 deletions

View File

@ -24,6 +24,15 @@ stderr 'go: downloading go1.999testmod \(.*/.*\)'
env GOPROXY= env GOPROXY=
env GOSUMDB= env GOSUMDB=
env GOTOOLCHAIN=go1.20.1 env GOTOOLCHAIN=go1.20.1
# Avoid resolving a "go1.20.1" from the user's real $PATH.
# That would not only cause the "downloading go1.20.1" message
# to be suppressed, but may spuriously fail:
# golang.org/dl/go1.20.1 expects to find its GOROOT in $HOME/sdk,
# but the script environment sets HOME=/no-home.
env PATH=
env path=
go version go version
stderr '^go: downloading go1.20.1 ' stderr '^go: downloading go1.20.1 '
stdout go1.20.1 stdout go1.20.1