]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/testdata/script: clear path in gotoolchain_issue66175
authorMichael Matloob <matloob@golang.org>
Fri, 10 May 2024 19:24:06 +0000 (15:24 -0400)
committerMichael Matloob <matloob@golang.org>
Fri, 10 May 2024 21:32:07 +0000 (21:32 +0000)
The gotoolchain_issue66175 script test would fail if a binary named
go1.21 or go1.22 was present in the system PATH. Clear the path at the
beginning of the test to make it independent of the system path.

Fixes #67277

Change-Id: I6d9133aee5b20ab116e07b659e8ecf3eb8add4ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/584258
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/go/testdata/script/gotoolchain_issue66175.txt

index c84ffbb0e7f8b1fc12bb9b433c993fddae023d87..5db4dbf3810ac867e79bef2337c00a61eb0d3352 100644 (file)
@@ -1,5 +1,10 @@
 env TESTGO_VERSION=go1.14
 
+# Clear the path so this test doesn't fail if the system running it\
+# has a binary named go1.21 or go1.22 on its path.
+[GOOS:plan9] env path=
+[!GOOS:plan9] env PATH=
+
 # check for invalid toolchain in go.mod
 go mod init m
 go mod edit -go=1.14 -toolchain=go1.22