x/pkgsite: Use visitor's GOOS when viewing documentation. #45298
Labels
Milestone
Comments
When you say "host", do you mean the machine running pkgsite as a server, or the machine running the browser that visits pkgsite? |
The machine running the browser that visits the site. I should have clarified that. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pkg.go.dev has the ability to show documentation for different
GOOS
by setting the variable in the URL or by using the dropdown. It does however not default to the host operating system like it did on godoc. This has lead to repeated confusion when people want to use a function, but find out it doesn't exist during compile time.An example of this is https://pkg.go.dev/github.com/creack/pty, which when viewed on a windows machine shows a function
Start
. When changing theGOOS
to windows it disappears.I would propose defaulting to the visitor's operating system when possible.
edit: clarified which host
The text was updated successfully, but these errors were encountered: