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
proposal: go/doc/comment: support doc links to builtins #53633
Comments
Change https://go.dev/cl/415554 mentions this issue: |
Personally I don't like something like |
|
Think you are correct. It makes sense for the documentation author, but not for the documentation reader, who might try literally typing "builtin.len". I don't necessarily want to suggest linking a plain Maybe |
If we do this, the next thing that will happen is that people insist every mention of [int] or [bool] or [len] be linked in doc comments. I think we can assume that people reading doc comments know about the Go language itself, including the builtins. |
This proposal has been added to the active column of the proposals project |
It might be helpful if I narrow this down to my specific use-case, which was top-level package documentation mentioning comparable, which people might not be familiar with yet. On reflection, I think this will only temporarily be something anyone feels like doc linking, and it is probably the wrong thing to do even then. I agree with rsc that we can expect Go programmers to be familiar with the builtins. Where they aren't yet (which is fine!), its not the job of every single Go package to explain them. I would still argue in general: If someone is writing educational code or tutorials for new Go programmers, I think they could very reasonably want to doclink a builtin. However, that is not my use-case so I can't argue this with any confidence. Therefore I withdraw/retract this proposal |
This proposal has been declined as retracted. |
The proposed (#51082) new doc comments should support doc links to builtins (e.g.
[builtin.comparable]
) in the same way as it currently does for other root-level standard libraries packages and their identifiers (e.g. the doc link[os.File]
)(pull request incoming)
The text was updated successfully, but these errors were encountered: