]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix TestScript/gotoolchain_net when $PATH contains golang.org/dl/go1.20.1
authorBryan C. Mills <bcmills@google.com>
Thu, 1 Jun 2023 14:13:11 +0000 (10:13 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 1 Jun 2023 15:53:59 +0000 (15:53 +0000)
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>
src/cmd/go/testdata/script/gotoolchain_net.txt

index 7d92b7231537f544edfa910540c00cf7c2a7ee8e..d04229d293747eb26d78d11539cc2ade40b51a7a 100644 (file)
@@ -24,6 +24,15 @@ stderr 'go: downloading go1.999testmod \(.*/.*\)'
 env GOPROXY=
 env GOSUMDB=
 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
 stderr '^go: downloading go1.20.1 '
 stdout go1.20.1