Closed
Description
This proposal is an amendment of the Go Workspace Proposal (#45713) originally suggested by @jayconrod in a comment on that issue:
I'd like a way to add all modules in a subtree to a workspace using wildcards. Specifically, I'd like
go workspace add ./...
.
go workspace use
would be a better subcommand name if we end up using that ingo.work
.- I think this would help build a more familiar environment for folks used to working on related projects in
GOPATH
. I could put ago.work
file in$GOPATH/src
, then just have one VSCode window for all projects.- We've talked about supporting wildcards in
go mod initwork
andgo mod editwork
, but that breaks some parallelism withgo mod init
, which only creates an emptygo.mod
file, andgo mod edit
, which only performs low-level syntactic edits without extra processing.
This proposal would add a new go
command subcommand, perhaps called go mod addwork
(if #48256 is accepted, the new subcommand would be called go work add
or go work use
).
It would ensure that the go.work command contains modules denoted by the given pattern, removing any matches of the pattern that no longer exist on disk.