What is the URL of the page with the issue?
https://pkg.go.dev/maps
What is your user agent?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Screenshot
What did you do?
I noticed that the examples for the maps package on pkg.go.dev are missing. The newly added methods like All, Keys, and others (5 in total) don't have examples, even though they exist in maps/example_test.go.
After that, I checked the documentation for slices and found the same issue: the examples for the new methods, such as All, Backward, and 5 others, are missing — but again, they are present in slices/examples_test.go.
The awkward part is that I was the last person to modify both files. After a brief moment of panic, I ran godoc -http=:9092 -goroot="." locally and accessed http://127.0.0.1:9092/pkg/maps/, and everything was as expected, with the examples present.
What did you see happen?
I'm not entirely sure about the difference between godoc -http=:9092 -goroot="." and pkg.go.dev, but I suspect that pkg.go.dev might be using a different Go version than the one marked here: Version: go1.23.1 Latest Published: Sep 5, 2024.
What did you expect to see?
Does this issue need to be fixed? Please give me some advice, I am happy to continue researching and fixing this issue
Comment From: gabyhelp
Related Issues and Documentation
- x/pkgsite: Package-level example not showing up on pkg.go.dev #48705 (closed)
- x/pkgsite: missing examples for https://pkg.go.dev/github.com/qqiao/pipeline@v1.0.0 #52363 (closed)
- x/pkgsite: `main` package symbols aren't documented: "There is no documentation for this package" #65731 (closed)
- x/pkgsite: package level Example quotes entire file, not just function code #39727 (closed)
- x/pkgsite: documentation feedback - tracking issue #37819 (closed)
- x/pkgsite: hyperlink does not inherit version for standard library packages. #68755
- x/pkgsite, x/tools/cmd/godoc: some code examples are not displayed (but work at godoc.org) #40172 (closed)
- x/pkgsite: add "Package files" section for commands #41396 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: seankhliao
you're looking at the docs for 1.23.1, but the added examples are in tip, see https://pkg.go.dev/maps@master
Comment From: cuishuang
you're looking at the docs for 1.23.1, but the added examples are in tip, see https://pkg.go.dev/maps@master
I see...thanks for your guidance!