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/cmd/godoc: single file examples are not displayed in package main like godoc.org #31669

Closed
nhooyr opened this issue Apr 25, 2019 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@nhooyr
Copy link
Contributor

nhooyr commented Apr 25, 2019

see golang/gddo#132

This issue was never fixed in the godoc tool.

Compare https://godoc.org/nhooyr.io/websocket#ex-package--Echo

Screen Shot 2019-04-24 at 11 19 30 PM

to locally

Screen Shot 2019-04-24 at 11 19 51 PM

@dmitshur dmitshur changed the title cmd/godoc: single file examples are not displayed in package main like godoc.org x/tools/cmd/godoc: single file examples are not displayed in package main like godoc.org Apr 25, 2019
@gopherbot gopherbot added this to the Unreleased milestone Apr 25, 2019
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 25, 2019
@LaPingvino
Copy link

I just found this issue when I got pinged because of issue golang/gddo#614, maybe a good idea to try to fix these together... Probably just applying the patch in issue golang/gddo#132 could solve this issue, but the other issue might still be present by doing this. I might give this one a go in the next few hours...

@LaPingvino
Copy link

Copying over my question in the gddo-issue: does anyone know why the Play method strips comments? Could this be changed to enable the fix for gddo to be backported to the godoc implementation and have expected comment-behavior?

@dmitshur
Copy link
Contributor

dmitshur commented Apr 30, 2019

maybe a good idea to try to fix these together

The plan is to indeed try to fix these together as part of the effort to unify Go package documentation rendering and adding module support to x/tools/cmd/godoc and gddo (issue #26827).

@dmitshur dmitshur self-assigned this Jul 31, 2019
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
@dmitshur
Copy link
Contributor

I think the reported example may have changed so it's hard to tell, but I expect this should be fixed on pkg.go.dev now. godoc is deprecated in favor of golang.org/x/pkgsite/cmd/pkgsite (see #49212), so closing this issue.

@golang golang locked and limited conversation to collaborators Jun 23, 2023
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. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants