-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add "goda why" or similar command #44
Comments
You can use Also there's |
Also sometimes using |
Ah fantastic, I only tried Is there any reason |
Honestly, I don't see a reason why it couldn't support it. And, if you want to take a stab at it, then great. Basically, you need to replace https://github.com/loov/goda/blob/master/tree/cmd.go#L48 with code https://github.com/loov/goda/blob/master/graph/cmd.go#L75 and then adjust the printing to work with the result. |
I have very often wanted to run a command to see why a dependency is required. This could be similar to
go mod why
, although that command is lacking a bit of functionality.Essentially, given an import tree of
I would like a command like:
goda why . c
I would expect:From this, I can see all of the places I need to clean up usages of
c
if I want to drop the dependency.I have done this exact thing before using a bunch of ad-hoc
goda
commands, resulting in out binary sizes being cut in half, so I think it would be pretty useful. It feels like all of the information is there, but not presentable in this way. Its also possible I just haven't found the right expressions to represent this.Alternatives:
Here the tree is pretty much the same, but in our real repo the tree is 12k lines so its not usable for this use case. The same with the graph - its too big to read without filtering
The text was updated successfully, but these errors were encountered: