Closed hyangah closed 2 weeks ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Thanks for investigating! This definitely needs to be fixed (see also #69321).
Change https://go.dev/cl/623175 mentions this issue: gopls/internal/test: fix path to local go in integration tests
The go directive in gopls's go.mod is set to
1.23.1
per #65917. The assumption is that gopls built with go1.23.1+ can be still used to analyze codebase with slightly older go versions. (e.g. go1.22.x, go1.21.x)Gopls integration tests run on workspaces created in temp directories outside golang.org/x/tools/gopls module and their go.mod files have go version old enough to prevent toolchain switch. With this setup, I hoped running gopls tests on go1.X builders (X < 23) is sufficient to test our assumption.
But it looks like this is not true.
CL 404134 prepends
GOROOT/bin
toPATH
ingo test
, as mentioned in #68005.In CL 616055 I attempted to verify the go version.
I don't know how we can recover the original
PATH
inside tests reliably.go test
also setsGOROOT
environment variable, too, but we can unset it.@golang/tools-team