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: Use visitor's GOOS when viewing documentation. #45298

Open
svenwiltink opened this issue Mar 30, 2021 · 2 comments
Open

x/pkgsite: Use visitor's GOOS when viewing documentation. #45298

svenwiltink opened this issue Mar 30, 2021 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite

Comments

@svenwiltink
Copy link

svenwiltink commented Mar 30, 2021

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 the GOOS to windows it disappears.

I would propose defaulting to the visitor's operating system when possible.

edit: clarified which host

@gopherbot gopherbot added this to the Unreleased milestone Mar 30, 2021
@jamalc jamalc assigned jamalc and unassigned jamalc Mar 30, 2021
@jamalc jamalc added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 30, 2021
@mvdan
Copy link
Member

mvdan commented Mar 31, 2021

When you say "host", do you mean the machine running pkgsite as a server, or the machine running the browser that visits pkgsite?

@svenwiltink
Copy link
Author

The machine running the browser that visits the site. I should have clarified that.

@svenwiltink svenwiltink changed the title x/pkgsite: Use host GOOS when viewing documentation. x/pkgsite: Use visitor's GOOS when viewing documentation. Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite
Projects
None yet
Development

No branches or pull requests

4 participants