-
Notifications
You must be signed in to change notification settings - Fork 83.1k
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
Go: Ignore Go workspace file go.work #3884
Conversation
With Go 1.18, support for Go workspaces will land. Go workspaces are configured in `go.work`, which contains paths to local development versions of modules and therefore is not expected to be commited. See: * golang/go#45713
Thanks for linking the documentation. I am referencing this line from Sebastian's article:
|
Hey, @breml! Should we also add |
@goto1134 I did not look into the details, but I guess adding |
Oh, I believe #4081 is about that. |
This is a terrible change. It means that any form of cross-module IDE feature doesn't work by default anymore for gopls users. Why would a multi-module repository want IDE features to be broken by default? |
@alvaroaleman. Consider working in a large mono repo. Different teams might need to have different workspace configurations for their local development. I believe the general idea about excluding the file from Git is not that bad. On the other hand, it is not that common for people to work in mono repo. Therefore, the default behavior should not restrict |
Any concrete example for this? Why would different teams want different workspace configurations within the same repo? Very typical examples of using multiple modules within the same repo include:
Not having a go.work means that LSP won't work across the submodule borders. This in turn means that you can for example can not do things like "Find references for this field in my api module" which is tremendously annoying. |
The original proposal for the feature says:
The exact problematic scenarios are discussed in the issue golang/go#53502. In the ticket Michael Matloob (the author of the proposal) mentions the disadvantages of checking-in the files. |
He also mentions reasons why it makes sense, so blanket assuming one seems wrong. |
Do you think, it could be a solution to your problem? |
It's so weird to accept this change... You wouldn't put |
Reasons for making this change:
With Go 1.18, support for Go workspaces will land. Go workspaces are configured in
go.work
, which contains paths to local development versions of modules and therefore is not expected to be commited.Links to documentation supporting these rule changes: