You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for io.EOF specifically indicates it should be used for graceful end-of-stream operations, and that io.ErrUnexpectedEOF should be used when more data was expected.
As such, I'd hope/expect the above playground link to print "unexpected EOF" rather than just "EOF".
This would allow me to distinguish between, for example, streamed reads where there is literally no more data available (we hit EOF before reading any bytes), versus a case where we read some bytes, but could not successfully parse the value.
The text was updated successfully, but these errors were encountered:
extemporalgenome
changed the title
io.ErrUnexpectedEOF should be returned instead of io.EOF when only partial data is presentio.ErrUnexpectedEOF should be returned instead of io.EOF when only partial data is present
Jul 7, 2023
codec returns io.EOF upon receiving truncated/incomplete data:
https://go.dev/play/p/retXRYuAszH
The documentation for
io.EOF
specifically indicates it should be used for graceful end-of-stream operations, and thatio.ErrUnexpectedEOF
should be used when more data was expected.As such, I'd hope/expect the above playground link to print "unexpected EOF" rather than just "EOF".
This would allow me to distinguish between, for example, streamed reads where there is literally no more data available (we hit EOF before reading any bytes), versus a case where we read some bytes, but could not successfully parse the value.
The text was updated successfully, but these errors were encountered: