This test checks a behavior of GOTOOLCHAIN when an appropriate
toolchain is found in PATH. That requires it to exclude any suitable
toolchain binaries from the user's $PATH, which may otherwise
interfere.
Fixes #62709.
Change-Id: Ie9161e52d33a65be0b5265cb49e9f2bc8473e057
Reviewed-on: https://go-review.googlesource.com/c/go/+/529217
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
# Compile a fake toolchain to put in the path under various names.
env GOTOOLCHAIN=
mkdir $WORK/bin
-[!GOOS:plan9] env PATH=$WORK/bin${:}$PATH
-[GOOS:plan9] env path=$WORK/bin${:}$path
go build -o $WORK/bin/ ./fakego.go # adds .exe extension implicitly on Windows
cp $WORK/bin/fakego$GOEXE $WORK/bin/go1.50.0$GOEXE
+[!GOOS:plan9] env PATH=$WORK/bin
+[GOOS:plan9] env path=$WORK/bin
+
go version
stdout go1.21pre3