Clarify ChunkReader.Next contract
This commit is contained in:
+2
-2
@@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
// ChunkReader is an interface to decouple github.com/jackc/chunkreader from this package.
|
// ChunkReader is an interface to decouple github.com/jackc/chunkreader from this package.
|
||||||
type ChunkReader interface {
|
type ChunkReader interface {
|
||||||
// Next returns buf filled with the next n bytes. If an error occurs, buf will be nil. Next must
|
// Next returns buf filled with the next n bytes. If an error (including a partial read) occurs,
|
||||||
// not reuse buf. In case of error, Next must preserve partially read data.
|
// buf must be nil. Next must preserve any partially read data. Next must not reuse buf.
|
||||||
Next(n int) (buf []byte, err error)
|
Next(n int) (buf []byte, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user