x/tools/go/packages: error during the call to packages.Load
with -mod
other than empty.
#43418
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
It's not related to a specific version of Go.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The problem is related to the
state.getGoVersion()
call:https://github.com/golang/tools/blob/929a8494cf60267d89035bc211b797a67b65a6b9/go/packages/golist.go#L848-L852
This call was introduced in golang/tools@2f4fa18
I think that the call creates this problem because of the hard-coded
GO111MODULE=off
https://github.com/golang/tools/blob/929a8494cf60267d89035bc211b797a67b65a6b9/internal/gocommand/version.go#L18
Because of the hard-coded
GO111MODULE=off
the value ofcfg.ModulesEnabled
isfalse
.go/src/cmd/go/internal/work/init.go
Lines 271 to 274 in 4fd9455
Related to golangci/golangci-lint#1502
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: