Fix godoc for re-exported blocks of comments#264
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes godoc rendering for re-exported type and constant blocks by adding blank lines after organizational comments. Previously, comments like "// Re-export stream-related types" would appear in the godoc for the first declaration in the following block, causing confusion in the public API documentation.
Changes:
- Added blank lines after all re-export organizational comments to separate them from subsequent declarations
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d48bcb4 to
7bb4ad8
Compare
|
I'm unsure this would be enough. As I'm removing random artifact in the documentation, but there are so much more to do to make it readable and usable by any Gopher. The fact we re-export internal leads to have a poor documentation. I wish someone could easily see that a LoadError as an Error, Line and Co. Also, it's not clear that a Load would return a LoadError that is a libyaml.ConstructError. We should improve things. But the way cyclic dependencies led us to do this doesn't help. A solution could be to us a package for errors, that can be imported then in yaml (root) and libyaml (internal), but that's not the way to do usually. Another solution could be to add wrapper and not aliases, but it adds a cost just for improving documentation. Maybe, I'm the only one worried about the internal being reexported and appearing with poor documentation |
4aa9195 to
84d315a
Compare
When re-exporting a block of comments, we added a comment just before the block to indicate that the block is re-exported. But the godoc will be rendered as being the comment for the next declaration, so the godoc of the first declaration. This leads to confusion when reading the documentation of the package. The "re-exported comment" shouldn't be visible in the publicly.
84d315a to
0134d57
Compare
When re-exporting a block of comments, we added a comment just before the block to indicate that the block is re-exported.
But the godoc will be rendered as being the comment for the next declaration, so the godoc of the first declaration.
This leads to confusion when reading the documentation of the package. The "re-exported comment" shouldn't be visible in the publicly.