I found a problem in the example functions across the entire codebase while exploring the Go website. Many Go examples have an unnecessary newline between the end of their code blocks and the output comment. This results in extra newlines on the Go website and pkgsite.
For example, check the source code and the example on the website.
What is the best approach for this? - Fix it on pkgsite and trim all the code examples. - Remove unnecessary newlines from the entire codebase. - Everything is fine, and those extra newlines don't affect the cleanliness and quality of the documentation.
Comment From: randall77
I think the newlines are fine in the source code.
It is annoying in pkgsite that there's a scrollbar whose sole purpose is to let us see that one extra blank line (at least, I suspect the causation works that way). So I would say, let's fix it there.
@golang/pkgsite
Comment From: seankhliao
I believe the example extraction is in go/doc rather than pkgsite https://go.googlesource.com/go/+/4f45b2b7e079fc03d3444642e8a33ce6f959c6a6/src/go/doc/example.go#580
Comment From: alirezaarzehgar
@randall77 @seankhliao
Thank you for your replies.
Can I be an assignee in this issue?
I'm a beginner and need time to explore source code to find a solution.
Comment From: gabyhelp
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: gopherbot
Change https://go.dev/cl/655115 mentions this issue: go/doc: fix trailing newlines in examples