From: Bryan C. Mills Date: Thu, 1 Jun 2023 14:13:11 +0000 (-0400) Subject: cmd/go: fix TestScript/gotoolchain_net when $PATH contains golang.org/dl/go1.20.1 X-Git-Tag: go1.21rc1~142 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5f08963b2cbc90a287a4aef5cf8a3d6a3b221692;p=gostls13.git 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 Auto-Submit: Bryan Mills TryBot-Bypass: Bryan Mills Reviewed-by: Russ Cox --- diff --git a/src/cmd/go/testdata/script/gotoolchain_net.txt b/src/cmd/go/testdata/script/gotoolchain_net.txt index 7d92b72315..d04229d293 100644 --- a/src/cmd/go/testdata/script/gotoolchain_net.txt +++ b/src/cmd/go/testdata/script/gotoolchain_net.txt @@ -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