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

x/tools/gopls (and friends): separate -modfile and -mod out of build flags #41826

stamblerre opened this issue Oct 6, 2020 · 1 comment


Copy link

@stamblerre stamblerre commented Oct 6, 2020

-modfile and -mod are passed to the Go command via BuildFlags, but the usage of these flags varies across the different go subcommands -- they are not always needed/supported. We should refactor the goimports ProcessEnv, go/packages Config, and gocommand Invocation to have separate ModFile and Mod fields that aren't part of BuildFlags.

/cc @heschik

@stamblerre stamblerre added this to the gopls/v1.0.0 milestone Oct 6, 2020
gopherbot pushed a commit to golang/tools that referenced this issue Oct 8, 2020
This is a temporary fix--golang/go#41826 is a better approach.

Fixes golang/go#41803

Change-Id: Ia055c5e171fe5d4f6d67e9e2e9e7c85fe254605e
Trust: Rebecca Stambler <>
Run-TryBot: Rebecca Stambler <>
TryBot-Result: Go Bot <>
Reviewed-by: Heschi Kreinick <>
Copy link

@gopherbot gopherbot commented Oct 16, 2020

Change mentions this issue: all: use explicit -mod, -modfile fields for gocommand.Invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.