Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLimitReached = errors.New("limit reached")
Functions ¶
This section is empty.
Types ¶
type LimitedReader ¶
A LimitedReader reads from R but limits the amount of data returned to just N bytes. Each call to Read updates N to reflect the new amount remaining. Read returns EOF when N <= 0 or when the underlying R returns ErrLimitReached.
func LimitReader ¶
func LimitReader(r io.Reader, n int64) *LimitedReader
Click to show internal directories.
Click to hide internal directories.