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/go: add a go work use
command
#48257
Comments
go mod addwork
commandgo mod addwork
command
Would there be a corresponding command to remove modules from the workspace? (That could be useful for, say, scripting.) |
Modules can still be removed by |
This proposal has been added to the active column of the proposals project |
@rsc Is it possible to review #48256 together at the proposal review meetings? (
|
@hyangah added to my list for next meeting, thanks. Not sure how I missed that one. |
go mod addwork
commandgo work use
command
In consultation with @jayconrod @rsc and @bcmills, we want to rename this proposed command to |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
go work use
commandgo work use
command
Change https://golang.org/cl/359534 mentions this issue: |
Change https://golang.org/cl/359412 mentions this issue: |
For golang/go#48257 Change-Id: I9cbb222c93a066717595bec14ff26f2902ef05d9 Reviewed-on: https://go-review.googlesource.com/c/mod/+/359412 Trust: Michael Matloob <matloob@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
For #45713, #48257 Change-Id: I7e9248f22fe7ab33b151e07cc296d64c194154e2 Reviewed-on: https://go-review.googlesource.com/c/go/+/359534 Trust: Michael Matloob <matloob@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
This is done. |
Change https://golang.org/cl/382240 mentions this issue: |
We had been statting 'dir' instead of 'absDir', which statted the wrong directory if 'dir' was made relative to the location of the go.work file and that location was different from the current working directory. While we're here, I also noticed some other dir-vs.-absDir discrepancies. The haveDirs map had assumed relative, slash-separated filesystem paths, but absolute paths on Windows are not slash-separated and we do retain those. Moreover, if users hand-edit the go.work file they may introduce non-canonical paths. I have changed the haveDirs logic to retain absolute paths in their platform-specific forms, and to call DropUse with the original path from the go.work file instead of the newly-resolved path. Fixes #50931 Updates #48257 Change-Id: Ib0a46179aa20c99f045aac5c7c02dbb55da455c8 Reviewed-on: https://go-review.googlesource.com/c/go/+/382240 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
This proposal is an amendment of the Go Workspace Proposal (#45713) originally suggested by @jayconrod in a comment on that issue:
This proposal would add a new
go
command subcommand, perhaps calledgo mod addwork
(if #48256 is accepted, the new subcommand would be calledgo work add
orgo 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.
cc @bcmills @ianthehat
The text was updated successfully, but these errors were encountered: