wasm: reading from stdin fails with Windows #43913
Labels
arch-wasm
WebAssembly issues
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Windows
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Code:
Build with:
What did you expect to see?
What did you see instead?
This is due to a bug in node where
fs.read
behaves incorrectly on Windows. It returns an EOF error when it hits the end of the file (the<object>
is the EOF error object). There are at least two reports including nodejs/node#35997 and nodejs/node#19831.However, I'm reporting it here because a) this bug is really old so it's all over the place in the wild and b) I think it's easy for Go to work around. My suggested workaround is to treat an EOF error from
fs.read
asnull
which should both avoid the panic and match Go's behavior on Unix.The text was updated successfully, but these errors were encountered: