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

proposal: cmd/go: add go workspace exclude directories #57086

switchupcb opened this issue Dec 5, 2022 · 2 comments

proposal: cmd/go: add go workspace exclude directories #57086

switchupcb opened this issue Dec 5, 2022 · 2 comments


Copy link

Step 1:
The proposal author creates a brief issue describing the proposal.
Note: There is no need for a design document at this point.
Note: A non-proposal issue can be turned into a proposal by simply adding the proposal label.
Note: Language changes should follow a separate template

First, I want to shout out @matloob for being a baller and solving #56697. He singlehandedly saved Google engineers millions of hours in error debugging time cause of this change. THANKS MATLOOB!


Go workspace is used to ensure a module in the workspace uses the import of the other module in the workspace.


In Disgo, I want to be able to exclude ./wrapper and _gen from Go Workspace defined:

go 1.18

use (

Can't do it or am missing something cause of the ./ which is necessary for the main package.

Exclude Directories

Most build tools allow the exclusion of directories. Even GNU Make that was made in 1977. I'm not sure what else to say to start this proposal. If there is a reason to not allow the exclusion of files, it's not clear. Perhaps, I am doing something incorrect. I'm just lost...

@gopherbot gopherbot added this to the Proposal milestone Dec 5, 2022
Copy link

_gen is already its own module, without being listed in, it is not part of the workspace.
wrapper is a package of the root module, it doesn't make sense to break up a module through a workspace.

In general, the exclusions are the same as for modules: carve out a nested module if necessary.

As there are no implicit includes in workspaces, it doesn't make sense to need an exclude directive.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2022
Copy link

@seankhliao Why do I have to specify GOWORK=off in #56697 (comment) for that folder?

@golang golang locked and limited conversation to collaborators Dec 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants