x/tools/gopls: race-like behaviour with GOFLAGS=-mod=readonly set #35933
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?Note that
github.com/myitcvforks/tools v0.0.0-20191119111301-0222b4b716c6
andgithub.com/myitcvforks/tools/gopls v0.0.0-20191119111301-0222b4b716c6
correspond to thex/tools
95cb2a1 with 80313e1 cherry picked on top. Reason being, we can't move beyond 95cb2a1 because otherwise we start tripping over the mistmatched versions problem described in #35114Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We have a
govim
test that verifies the setting of the"env"
valueGOFLAG=-mod=readonly
. It is based on the following setup:(
example.com/blah
is a valid module and is accessible).We initially verify that the
go.mod
file is not changed bygopls
as we openmain.go
.However we are seeing race-like behaviour from
gopls
. Sometimes we see an initial diagnostic formain.go
(pass), sometimes not (fail).The apparently significant line in
fail.log
is as follows:This is consistent with us testing with
GOFLAGS=-mod=readonly
, but it does not explain why we don't see this same error consistently. Hence the thinking there is a race with some initial loading thatgopls
is doing?In any case, we don't think the load via
go/packages
should be fatal.What did you expect to see?
Consistently receiving an initial diagnostic from
gopls
formain.go
What did you see instead?
As above.
cc @stamblerre, @matloob
The text was updated successfully, but these errors were encountered: