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/pkgsite: comments in example code are not visible #40710

Closed
cgxeiji opened this issue Aug 12, 2020 · 3 comments
Closed

x/pkgsite: comments in example code are not visible #40710

cgxeiji opened this issue Aug 12, 2020 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite

Comments

@cgxeiji
Copy link

cgxeiji commented Aug 12, 2020

Sometimes, adding comments to the examples can help illustrate how a package works.

While godoc.org shows comments in the example code, pkg.go.dev does not (example code in pkg.go.dev) for the same package.

I do not know if this is intended behavior, or if comments in examples should be avoided.

Thank you

@gopherbot gopherbot added this to the Unreleased milestone Aug 12, 2020
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 17, 2020
@dmitshur
Copy link
Contributor

dmitshur commented Aug 17, 2020

Thanks for reporting. Comments in the example code should be shown. They're shown on golang.org/pkg (aka x/tools/cmd/godoc) and on godoc.org (as you said). This looks like a bug in x/pkgsite.

/cc @julieqiu @jba @jamalc per owners.

@dmitshur dmitshur changed the title x/pkgsite: Comments in examples are not shown x/pkgsite: comments in example code are not visible Aug 17, 2020
@gopherbot
Copy link

Change https://golang.org/cl/248997 mentions this issue: internal/fetch: add comments in example code

gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 18, 2020
Change current render implementation of example code to display
comments.

before: https://i.imgur.com/vQYHEn6.png
after: https://i.imgur.com/wS5maVS.png

Updates golang/go#40710

Change-Id: I51fafbc49cc753179bdca997f1ea4df2f17127b5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/248997
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
@julieqiu
Copy link
Member

Fixed.

@golang golang locked and limited conversation to collaborators Aug 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite
Projects
None yet
Development

No branches or pull requests

4 participants