Clarify behaviour of Next()

This commit is contained in:
Alexander Neumann 2014-09-18 22:22:44 +02:00
parent 8e24a8b811
commit 1c03bd7f7b

View file

@ -44,9 +44,9 @@ type Chunk struct {
// A chunker takes a stream of bytes and emits average size chunks. // A chunker takes a stream of bytes and emits average size chunks.
type Chunker interface { type Chunker interface {
// Next returns the next chunk of data. If an error occurs while reading, // Next returns the next chunk of data. If an error occurs while reading,
// the error is returned. The state of the current chunk is undefined. When // the error is returned with a nil chunk. The state of the current chunk
// the last chunk has been returned, all subsequent calls yield a nil chunk // is undefined. When the last chunk has been returned, all subsequent
// and an io.EOF error. // calls yield a nil chunk and an io.EOF error.
Next() (*Chunk, error) Next() (*Chunk, error)
} }