-
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
bytes: Buffer.ReadFrom should not ignore io.EOF #66155
Comments
This behavior is explicitly documented by
I don't see why it should return |
In Go, returning a non-nil error from a function/method indicates there is something wrong. In this case, |
This would break a lot of existing code that has been programed to the documented contract. |
Thanks, but we aren't going to make this change. |
Go version
go version go1.22.0 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
This code block breaks util loop 1000 times ,but we expect this loop break when the readFrom throws io.EOF .
The bytes library shows the readFrom source code as below :
The source code throws nil insteadOf io.EOF .
What did you expect to see?
I Suggest readFrom throws io.EOF,so that keep the same as others io operatoions.
The text was updated successfully, but these errors were encountered: