x/tools/gopls: race-like behaviour with GOFLAGS=-mod=readonly set #35933
Comments
CL 209420 suppresses these errors when |
That's relatively difficult to test at this point in time. We're looking to keep pace with the latest This particular issue was seen in another feature branch which also has lots of changes. Hence at this stage I can't easily confirm whether it has/hasn't fixed the issue. |
Ah, I think I know what's going on here. Since we added the behavior of diagnosing all packages in a workspace on initialized, we are now racing with the type-check that also gets triggered after I think this issue can be closed, but please open an issue if you see this again in |
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: