Skip to content

Commit 676858f

Browse files
author
Bryan C. Mills
committed
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 <[email protected]> Run-TryBot: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Daniel Martí <[email protected]> Trust: Daniel Martí <[email protected]>
1 parent d99ff03 commit 676858f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/go/go_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1631,7 +1631,7 @@ func TestListTemplateContextFunction(t *testing.T) {
16311631
}{
16321632
{"GOARCH", runtime.GOARCH},
16331633
{"GOOS", runtime.GOOS},
1634-
{"GOROOT", filepath.Clean(runtime.GOROOT())},
1634+
{"GOROOT", testGOROOT},
16351635
{"GOPATH", os.Getenv("GOPATH")},
16361636
{"CgoEnabled", ""},
16371637
{"UseAllFiles", ""},

0 commit comments

Comments
 (0)