From 154394f8d35ebd084f27132396d90309646cafcf Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 29 Jul 2018 13:15:25 +0200 Subject: [PATCH] cmd/go: fix TestScript/mod_gobuild_import on Plan 9 CL 125296 added TestScript/mod_gobuild_import. This test is failing on Plan 9, because go/build invokes the go tool which cannot be found in the path. The "PATH" environment variable has been updated to contain the path to the go tool on Unix and Windows, but on Plan 9, the analogous environment variable is called "path". This change fixes the script engine by setting the "path" environment variable on Plan 9. Fixes #26669. Change-Id: If1be50e14baceccee591f4f76b7e698f5e12a2d4 Reviewed-on: https://go-review.googlesource.com/126608 Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/go/script_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go index 263e26fa35..90cf3a5679 100644 --- a/src/cmd/go/script_test.go +++ b/src/cmd/go/script_test.go @@ -98,6 +98,10 @@ func (ts *testScript) setup() { ":=" + string(os.PathListSeparator), } + if runtime.GOOS == "plan9" { + ts.env = append(ts.env, "path="+testBin+string(filepath.ListSeparator)+os.Getenv("path")) + } + if runtime.GOOS == "windows" { ts.env = append(ts.env, "exe=.exe") } else {