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: package level Example quotes entire file, not just function code #39727

Closed
mroth opened this issue Jun 20, 2020 · 2 comments
Closed

Comments

@mroth
Copy link

mroth commented Jun 20, 2020

What is the URL of the page with the issue?

https://pkg.go.dev/github.com/mroth/weightedrand@v0.2.2?tab=doc#example-package

What is your user agent?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15

Screenshot

Package Example function in godoc.org:
Screen Shot 2020-06-20 at 10 09 17 AM

Package Example unction in pkg.go.dev:
Screen Shot 2020-06-20 at 10 09 52 AM
(snipped...)

What did you do?

Use a package level Example function in the godocs for a module.

What did you expect to see?

The example code and output for the Example function only rendered at the top of the package documentation page.

What did you see instead?

The "code" section of the example function contains the source of the entire file, not just the Example function.

@gopherbot gopherbot added this to the Unreleased milestone Jun 20, 2020
@mvdan
Copy link
Member

mvdan commented Jun 20, 2020

Possibly related to (or even a duplicate of) #39006.

@mvdan mvdan added the pkgsite label Jun 20, 2020
@gopherbot
Copy link

Change https://golang.org/cl/239180 mentions this issue: internal/fetch/internal/doc: fix detection of whole file examples

@golang golang locked and limited conversation to collaborators Jun 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants