Skip to content
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: [Context.Err] not linked in rendered doc comments #63679

Open
mitar opened this issue Oct 23, 2023 · 10 comments
Open

go/doc,x/pkgsite: [Context.Err] not linked in rendered doc comments #63679

mitar opened this issue Oct 23, 2023 · 10 comments
Labels
Documentation NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mitar
Copy link
Contributor

mitar commented Oct 23, 2023

Variables section has invalid links:

Screenshot 2023-10-23 at 08-50-35 context package - context - Go Packages

See [Context.Err].

@bcmills
Copy link
Contributor

bcmills commented Oct 23, 2023

Possibly related to #61394?

@bcmills bcmills changed the title context: documentation does not render correctly go/doc,x/pkgsite: [Context.Err] not linked in rendered doc comments Oct 23, 2023
@Goclipse27
Copy link
Contributor

@mitar @bcmills - thanks for linking package zip and struct field link in doc. Here Context.Err - method is in interface and any struct that implements it call the method. Is there in any other package docs, has such link? Shall I help on this issue?

@seankhliao
Copy link
Member

see also #39963

@hyangah
Copy link
Contributor

hyangah commented Oct 24, 2023

I observed the similar in gopls's hover message.

@Goclipse27
Copy link
Contributor

Thanks @seankhliao.

If we see - https://pkg.go.dev/golang.org/x/mod@v0.12.0/zip#CheckDir - CheckedFiles.Err) is referred as a link in the doc. As Err is a method for CheckedFiles struct and its reference works. Where as [CheckedFiles.SizeError] is a field int struct, it's reference is not working and it has been discussed in #39963 (comment). Looks like @bcmills trying a fix for fields in struct - https://go-review.googlesource.com/c/go/+/510315/6/src/go/doc/doc.go.

Here the situation is for interface methods. As we go with standards - https://go.dev/doc/comment#doclinks. We can try refer only the interface followed by method [context.Context].Err as interface doclinks work - (Example (https://cs.opensource.google/go/go/+/go1.21.3:src/bufio/bufio.go;l=215 , then this Read method can do so as well; see the [io.Reader] docs.)

Any suggestions/feedback are appreciated.

@Goclipse27

This comment was marked as resolved.

@dr2chase dr2chase added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 26, 2023
@Goclipse27
Copy link
Contributor

@mitar @bcmills @dr2chase @hyangah - I am able to reproduce the issue locally. And I tried linking interface followed Err() and docs link work too. Please find the screenshot attached. Let me know your feedback.

Screenshot 2023-10-29 072554

@Goclipse27
Copy link
Contributor

Goclipse27 commented Nov 6, 2023

@mitar @hyangah Please do review if the fix looks ok - https://go-review.googlesource.com/c/go/+/540175

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/540175 mentions this issue: go/doc,x/pkgsite: [Context.Err] not linked in rendered doc comments #63679

@AlexanderYastrebov
Copy link
Contributor

Looks like a duplicate of #62293 which also proposes a fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

8 participants