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
x/tools/cmd/godoc: list packages in the correct order #15020
Comments
godoc sorts imports within groups. If you want to maintain groups, use golang.org/x/tools/cmd/goimports. |
Sorry, but what do you mean with "use golang.org/x/tools/cmd/goimports"? I'm referring to the package index available at As you can see from https://imagebin.ca/v/2c2N6BhjBUmp, finding documentation for a standard package is quite a pain, since all third party packages are interleaved with standard packages. |
I'm sorry, I misunderstood your comment. I don't understand your reference to the CodeReviewComments wiki page, as that has nothing to do with what godoc displays. You are suggesting that godoc should sort the packages it displays differently. |
CC @griesemer |
I added a reference to CodeReviewComments because Go programmers expect to see packages listed in a well defined order, and this order is not respected by godoc. However the real problem is that godoc package listing seems to be specialized for https://golang.org/pkg/. One possible solution is to add an additional section, that it is only visible when there are third-party packages installed on the system. |
Duplicate of #3305. My CL does exactly that. |
Change https://golang.org/cl/95835 mentions this issue: |
https://github.com/golang/go/wiki/CodeReviewComments#imports says that
"Imports are organized in groups, with blank lines between them. The standard library packages are in the first group."
.However godoc simply sorts imports in lexicographical order.
This makes it very hard to find the documentation of a standard package.
The order should be:
The text was updated successfully, but these errors were encountered: