Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/govim: add ExperimentalAllowModfileModifications #1027

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

myitcv
Copy link
Member

@myitcv myitcv commented Feb 1, 2021

ExperimentalAllowModfileModifications controls whether gopls should
automatically modify go.{mod,sum} as a side effect of its use of cmd/go
or not. Setting this option to true can be considered a gopls equivalent
to setting GOFLAGS=-mod=mod when using cmd/go. Leaving it unset or
setting it to false is equivalent to -mod=readonly. Indeed setting
GOFLAGS=-mod=XYZ is now considered deprecated as a means of controlling
this behaviour in gopls.

For reference: in Go 1.16 cmd/go build commands default to -mod=readonly
(equivalent to leaving this option unset, or setting it to false),
whereas prior to Go 1.16 the default was -mod=mod (equivalent to setting
this option to true).

golang.org/issue/44008 tracks confirmation that this gopls option will
not be removed until a better alternative is found.

ExperimentalAllowModfileModifications controls whether gopls should
automatically modify go.{mod,sum} as a side effect of its use of cmd/go
or not. Setting this option to true can be considered a gopls equivalent
to setting GOFLAGS=-mod=mod when using cmd/go. Leaving it unset or
setting it to false is equivalent to -mod=readonly. Indeed setting
GOFLAGS=-mod=XYZ is now considered deprecated as a means of controlling
this behaviour in gopls.

For reference: in Go 1.16 cmd/go build commands default to -mod=readonly
(equivalent to leaving this option unset, or setting it to false),
whereas prior to Go 1.16 the default was -mod=mod (equivalent to setting
this option to true).

golang.org/issue/44008 tracks confirmation that this gopls option will
not be removed until a better alternative is found.
@myitcv myitcv requested a review from leitzler February 1, 2021 06:36
Copy link
Member

@leitzler leitzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@myitcv myitcv merged commit 7bb65e2 into main Feb 2, 2021
@myitcv myitcv deleted the add_allow_modfile_modifications_options branch February 2, 2021 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants