diff options
author | Bryan C. Mills <bcmills@google.com> | 2022-03-10 15:09:17 -0500 |
---|---|---|
committer | Bryan Mills <bcmills@google.com> | 2022-03-14 17:51:51 +0000 |
commit | 676858f3d4786054e1b27b999b5e73190f25288c (patch) | |
tree | d34ced5b2ac5a651335cf8a115606150c19f9f31 /src/cmd | |
parent | d99ff0382116bb472b9f92ddf23cb22bf145bbcd (diff) | |
download | go-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.go | 2 |
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", ""}, |