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/doc: odd formatting when last method lacks documentation #30492
Comments
Interesting. On a different note, the /cc @robpike |
Found it. I have 2 possible fixes for it. One is unconditionally change 1 to 2 here in } else {
pkg.newlines(1)
} Interestingly this was done to fix #12756 filed by @dsnet himself, which was also about the There are side-effects to this approach. Since we are always printing a gap after a method, so now functions inside interfaces without a comment do not have a gap. Before --
After--
To make it consistent, we would need to add a gap after functions too. Another alternative is cleaner, but conditional. We check if a @robpike for decision. |
I'd go for checking fun.Doc but it doesn't really matter much. Either solution is fine. |
Change https://golang.org/cl/166178 mentions this issue: |
Using
go1.12
The
LimitedReader.Read
method has no documentation, so does not print an empty line below it. This makes the output odd as it visually looks likeLimitedReader.Read
is more related toPipeReader
than it does withLimitedReader
.What I expected to see:
func (l *LimitedReader) Read(p []byte) (n int, err error) + type PipeReader struct { // Has unexported fields. }
The text was updated successfully, but these errors were encountered: