x/tools/gopls: switch default to -mod=readonly #41437
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Soon
This needs to be done soon. (regressions, serious bugs, outages)
Tools
This label describes issues relating to any tools in the x/tools repository.
Projects
Milestone
In CLs 253799 and 254756, @heschik switched to explicitly using
-mod=mod
to preserve the current behavior ofgopls
with Go 1.16. Since-mod=mod
will be deprecated, we need an alternative approach for the future.A proposed solution has been to run
go mod tidy
beforegopls
runsgo/packages.Load
. This can be done with-modfile
or in the temporary workspace module. This way, we preserve the existing behavior that allows users to edit modules that don't compile, but we still offergo mod tidy
diagnostics. These diagnostics should be upgraded to errors (with Go 1.16)./cc @jayconrod @findleyr
The text was updated successfully, but these errors were encountered: