-
Notifications
You must be signed in to change notification settings - Fork 18k
proposal: cmd/go: add go work use -r -maxdepth #52381
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
what are the practical/real world cases is which this is useful? |
most go modules are defined at the root directory of repos, and most people have go projects cloned onto their local filesystem either in one directory (flat layout) or in a hierarchy of sub-directories with a known/limited depth. So a |
Depth seems like a poor proxy for the actual issues, a multi module repository can easily have modules at different depths, while a checked out dependency in the same workspace (eg, |
Even for cases where a directory level contains both desirable go modules and undesirable ones, limiting the search scope with a max depth would result in fewer (or equal) undesirable ones that need to be pruned out than that of allowing the search scope to be unbound. |
go work use -r
go work use -r
go work use -r
This proposal has been added to the active column of the proposals project |
Because -r is not the default, another option is to use other file walking tools to prepare a list of directories passed to go work use. It seems like -r does not need all the bells and whistles. |
Yeah, I'm okay with that. |
This proposal has been declined as retracted. |
I propose that we add a new optional
-maxdepth <uint>
flag togo work use -r moddirs
. It limits the level of directories to descend into for eachmoddirs
, like how the-maxdepth
in the Unixfind
command works.The text was updated successfully, but these errors were encountered: