summaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2022-03-10 15:09:17 -0500
committerBryan Mills <bcmills@google.com>2022-03-14 17:51:51 +0000
commit676858f3d4786054e1b27b999b5e73190f25288c (patch)
treed34ced5b2ac5a651335cf8a115606150c19f9f31 /src/cmd
parentd99ff0382116bb472b9f92ddf23cb22bf145bbcd (diff)
downloadgo-git-676858f3d4786054e1b27b999b5e73190f25288c.tar.gz
cmd/go: use testGOROOT in TestListTemplateContextFunction
This test uses testgo to run 'go list', so it should use the correct GOROOT for testgo. (This may be particularly relevant when the test binary itself is build with -trimpath, in which case runtime.GOROOT() is not valid.) Updates #51483 Change-Id: I79b310f88e3a200122d6289073df1385e3e97cca Reviewed-on: https://go-review.googlesource.com/c/go/+/391801 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Trust: Daniel Martí <mvdan@mvdan.cc>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/go/go_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go
index 01356f9dd0..fa0d44dae6 100644
--- a/src/cmd/go/go_test.go
+++ b/src/cmd/go/go_test.go
@@ -1631,7 +1631,7 @@ func TestListTemplateContextFunction(t *testing.T) {
}{
{"GOARCH", runtime.GOARCH},
{"GOOS", runtime.GOOS},
- {"GOROOT", filepath.Clean(runtime.GOROOT())},
+ {"GOROOT", testGOROOT},
{"GOPATH", os.Getenv("GOPATH")},
{"CgoEnabled", ""},
{"UseAllFiles", ""},