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

x/tools/godoc: struct field anchor is added to wrong location when another field comment above it has same prefix #37041

Open
c-yan opened this issue Feb 5, 2020 · 3 comments

Comments

@c-yan
Copy link

@c-yan c-yan commented Feb 5, 2020

Certificate.Leaf is linked to Certificate.PrivateKey instead of the location in the Certificate.Leaf field.

@odeke-em
Copy link
Member

@odeke-em odeke-em commented Feb 5, 2020

Thank you for this report @c-yan!

Kindly paging @katiehockman @FiloSottile.

@odeke-em odeke-em added this to the Backlog milestone Feb 5, 2020
@FiloSottile FiloSottile changed the title crypto/tls: Certificate.Leaf is not linked correctly x/tools/cmd/godoc: Certificate.Leaf anchor is incorrect Feb 5, 2020
@FiloSottile
Copy link
Contributor

@FiloSottile FiloSottile commented Feb 5, 2020

Hah, it's because there's a documentation line that starts with Leaf in the PrivateKey docs.

This is an x/tools/cmd/godoc bug.

/cc @dmitshur

@gopherbot gopherbot added the Tools label Feb 5, 2020
@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Feb 6, 2020

Good analysis @FiloSottile.

As an observation, this bug is not present in the documentation rendering algorithm used by pkg.go.dev:

https://pkg.go.dev/crypto/tls/#Certificate.Leaf

/cc @julieqiu

We can use this issue to track the problem in golang.org/x/tools/cmd/godoc. If it's not fixed separately, it should get resolved when its rendering algorithm is unified with the others.

@dmitshur dmitshur changed the title x/tools/cmd/godoc: Certificate.Leaf anchor is incorrect x/tools/godoc: struct field anchor is added to wrong location when another field comment above it has same prefix Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants