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: syscall.Stdin Stdout and Stderr documentation is wrong for Windows #66083

Closed
AidanWelch opened this issue Mar 4, 2024 · 2 comments
Labels
Milestone

Comments

@AidanWelch
Copy link

AidanWelch commented Mar 4, 2024

What is the URL of the page with the issue?

https://pkg.go.dev/syscall#pkg-variables

What is your user agent?

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0

Screenshot

No response

What did you do?

Just read it

What did you see happen?

var (
	Stdin  = 0
	Stdout = 1
	Stderr = 2
)

Is stated to be each value. However, in Windows instead each value is a handle(determined at compile time).

What did you expect to see?

Further clarification that in Windows it is a Handle and not a file descriptor. For example

var (
	Stdin  = getStdHandle(STD_INPUT_HANDLE)
	Stdout = getStdHandle(STD_OUTPUT_HANDLE)
	Stderr = getStdHandle(STD_ERROR_HANDLE)
)

STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, and STD_ERROR_HANDLE correspond to -10, -11, and -12 respectively as defined here https://learn.microsoft.com/en-us/windows/console/getstdhandle as is getStdHandle

@gopherbot gopherbot added this to the Unreleased milestone Mar 4, 2024
@rittneje
Copy link

rittneje commented Mar 4, 2024

At the top of the page, you can see a drop-down labeled "Rendered for", which defaults to "linux/amd64". If you change that to "windows/amd64" then you will see the expected documentation. https://pkg.go.dev/syscall?GOOS=windows#pkg-variables

@AidanWelch
Copy link
Author

Oh thank you! Sorry!

@AidanWelch AidanWelch closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants