-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: separate direct and indirect dependencies in go.mod #27887
Comments
@gopherbot, please add label modules |
@jamesgoodhouse you might also want to see the discussion in #26955 and #26913, especially this comment #26913 (comment) |
Note, the list of indirect dependencies in your That said, a more useful way to look at your dependencies is
|
@jamesgoodhouse I understand this is not exactly what you asked for, but note that
That https://tip.golang.org/cmd/go/#hdr-List_packages_or_modules Here is the
In contrast, for that same example above, a
Again, I understand it might be more convenient to be able to more easily see direct vs. indirect in |
The build definition file in any system should be easily readable and understandable. I understand that typically Cluttering the Simply adding a blank line and separating the direct and indirect dependencies would go a long way in cleaning up the presentation of the |
Adding some notes per a discussion with @DemonWav on Slack. In my experience with modules thus far, a) I never made changes to a I agree that it's easier to glance at your |
@DemonWav, the To answer the question “what are the modules that provide the direct imports of my non-test packages?”, you could do something like:
See also #27900. |
It's valuable to can read https://research.swtch.com/vgo-module However about the annoying |
file this under the ease of use category.. If the auto formatter can make a few of our lives easier, why not do it? It should also sort the dependencies alphabetically for even easier browsing. |
I think this is more-or-less exactly implemented for |
Duplicate of #45965 |
To summarize, the ordering of the
go.mod
file, with direct and indirect dependencies intermixed, makes it hard to view direct dependencies that I actually care about.A proposed fix would be...
What version of Go are you using (
go version
)?go1.11 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Run
go mod tidy
in a newly initialized project.What did you expect to see?
An orderly
go.mod
file, with dependencies I care about and use directly separated out from indirect dependencies.What did you see instead?
Direct and indirect dependencies intermixed in the
go.mod
file, leading toward difficulty in see modules I use and care about.The text was updated successfully, but these errors were encountered: