-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
go/doc,x/pkgsite: struct fields inconsistently linked in doc comments #61394
Comments
I think the bug is in |
Change https://go.dev/cl/510315 mentions this issue: |
Change https://go.dev/cl/528402 mentions this issue: |
This is blocked awaiting code review, so moving to Backlog. |
I was about to file an issue for net/http.Transport documentation rendering and then I found this issue.
Hope https://go.dev/cl/510315 gets some attention soon. |
I would love to see this hit 1.23 is there any chance of that @bcmills and is there anything I can do to help make that happen? |
I'm no longer on the Go team so there's zero chance of my CL landing as-is — but you're welcome to clone it and shepherd it through the review process! 🙃 |
This is quite a visible issue with rendered package docs. There are about 30 instances where it occurs in the net/http documentation alone. @griesemer and @golang/pkgsite -- can you suggest a good person to own this? |
https://go.dev/doc/comment#doclinks currently says:
but it is somewhat ambiguous about whether the
[Name1.Name2]
form can refer to struct fields or only methods.In practice, people do seem to intuitively expect references to struct fields to work; for example, this comment on
types.Package.GoVersion
(written by @rsc) refers to thego/ast.File.GoVersion
struct field, andpkg.go.dev
appears to render that reference correctly:However, similar references within the same package are not rendered as links. For example, the reference to
[CheckedFiles.SizeError]
fromzip.CheckedFiles.Err
is currently rendered as plain text:go/doc.Parser
uses different functions to resolve intra- vs. inter-package references: it appears that theLookupPackage
hook being used bypkgsite
does resolve struct fields, whereas theLookupSym
hook does not.The text was updated successfully, but these errors were encountered: