-
Notifications
You must be signed in to change notification settings - Fork 18k
x/website/_content/ref: clarify documentation of go work use -r
#68245
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
Comments
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
go work use -r
go work use -r
Okay, so reading "use directives will be added for directories that exist, and removed for directories that do not exist", the subject for both "added" and "removed" seems to me to clearly be "use directives" rather than "directories". Would "use directives will be added for directories that exist, and they will be removed for directories that do not exist" be more clear? Or maybe "use directives will be added for directories that exist, and use directives will be removed for directories that do not exist"? It's clunky but it's harder to misinterpret. |
I think the mix-up may be on my end; I did not interpret it as "the go tool will remove the actual directories". I was thinking of this scenario: Suppose I already have a |
Oh I see. The behavior is that only directories that would be under the tree specified with I'm not sure how to rephrase it without making it more awkward. Maybe we can remove the last part of the sentence entirely? "The -r flag searches recursively for modules in the argument directories, and the use command operates as if each of the directories were specified as arguments." Or maybe "The -r flag searches recursively for modules in the argument directories, and the use command operates as if each of the directories were specified as arguments: namely, use directives will be added for directories that exist, and removed for paths that are under the argument directories but do not exist." |
The shorter "The -r flag searches recursively for modules in the argument directories, and the use command operates as if each of the directories were specified as arguments" seems better to me - thanks! |
Change https://go.dev/cl/595536 mentions this issue: |
Change https://go.dev/cl/595997 mentions this issue: |
A statement in the go work use docs that was meant to clarify that go work use would clean up use statements where the directories did not exist ended up causing confusion. Remove that statement for now. We might want to add something back in the future. For #68245 Change-Id: I7f6646b5dd05c18aa15e0e54f2816753f318404e Reviewed-on: https://go-review.googlesource.com/c/go/+/595536 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Eli Bendersky <[email protected]>
A statement in the go work use docs that was meant to clarify that go work use would clean up use statements where the directories did not exist ended up causing confusion. Remove that statement for now. We might want to add something back in the future. For golang#68245 Change-Id: I7f6646b5dd05c18aa15e0e54f2816753f318404e Reviewed-on: https://go-review.googlesource.com/c/go/+/595536 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Eli Bendersky <[email protected]>
Go version
any
Output of
go env
in your module/workspace:What did you do?
The documentation at https://go.dev/ref/mod#go-work-use currently says:
Which can be taken as "the command will remove directories from the go.work file that weren't found in the recursive tree under the arguments passed to
-r
"What did you see happen?
n/a
What did you expect to see?
n/a
The text was updated successfully, but these errors were encountered: