From: Bryan C. Mills Date: Thu, 10 Mar 2022 20:09:17 +0000 (-0500) Subject: cmd/go: use testGOROOT in TestListTemplateContextFunction X-Git-Tag: go1.19beta1~1078 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=676858f3d4786054e1b27b999b5e73190f25288c;p=gostls13.git 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 Run-TryBot: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Daniel Martí Trust: Daniel Martí --- 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", ""},