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

Golang x/pkgsite: Some examples of functions are missing, but there are relevant example codes in the source code

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.

Golang x/pkgsite: Some examples of functions are missing, but there are relevant example codes in the source code

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.

Golang x/pkgsite: Some examples of functions are missing, but there are relevant example codes in the source code

Golang x/pkgsite: Some examples of functions are missing, but there are relevant example codes in the source code

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

(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!