-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
os.File.Read() yields os.EOF when len(buf) = 0 #2402
Labels
Comments
I did not ignore the error of os.Open(). Just in this example to keep it short. Opening succeeds. Also, if I do `buf := make([]byte, 1)`, I get data. So, I just looked into $GOROOT/src/pkg/os/file.go which states in Line 72: if n == 0 && !iserror(e) { return 0, EOF } This will of course occur, when I *want* to read 0 bytes. I personally think this is rather unexpected behaviour. |
http://golang.org/cl/5298081 Status changed to Started. |
This issue was closed by revision 4853c51. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by alexander.surma:
The text was updated successfully, but these errors were encountered: