x/pkgsite: package level Example quotes entire file, not just function code #39727
Labels
Milestone
Comments
Possibly related to (or even a duplicate of) #39006. |
Change https://golang.org/cl/239180 mentions this issue: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:

Package Example unction in pkg.go.dev:

(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.
The text was updated successfully, but these errors were encountered: