Skip to content

Commit

Permalink
io: make clear that EOF should not be wrapped
Browse files Browse the repository at this point in the history
For #40827.

Change-Id: Ifd108421abd8d0988dd7b985e4f9e2bd5356964a
Reviewed-on: https://go-review.googlesource.com/c/go/+/258524
Trust: Russ Cox <[email protected]>
Reviewed-by: Rob Pike <[email protected]>
  • Loading branch information
rsc committed Oct 1, 2020
1 parent b8ec1d5 commit 9b1518a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/io/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ var ErrShortWrite = errors.New("short write")
var ErrShortBuffer = errors.New("short buffer")

// EOF is the error returned by Read when no more input is available.
// (Read must return EOF itself, not an error wrapping EOF,
// because callers will test for EOF using ==.)
// Functions should return EOF only to signal a graceful end of input.
// If the EOF occurs unexpectedly in a structured data stream,
// the appropriate error is either ErrUnexpectedEOF or some other error
Expand Down

0 comments on commit 9b1518a

Please sign in to comment.