Skip to content

Commit 30886b1

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
cmd/go: in TestScript/gotoolchain_path, remove the user's PATH
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 <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent cc904eb commit 30886b1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cmd/go/testdata/script/gotoolchain_path.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ env TESTGO_VERSION=go1.21pre3
88
# Compile a fake toolchain to put in the path under various names.
99
env GOTOOLCHAIN=
1010
mkdir $WORK/bin
11-
[!GOOS:plan9] env PATH=$WORK/bin${:}$PATH
12-
[GOOS:plan9] env path=$WORK/bin${:}$path
1311
go build -o $WORK/bin/ ./fakego.go # adds .exe extension implicitly on Windows
1412
cp $WORK/bin/fakego$GOEXE $WORK/bin/go1.50.0$GOEXE
1513

14+
[!GOOS:plan9] env PATH=$WORK/bin
15+
[GOOS:plan9] env path=$WORK/bin
16+
1617
go version
1718
stdout go1.21pre3
1819

0 commit comments

Comments
 (0)