Documentation
¶
Overview ¶
Package iotest implements Readers and Writers useful mainly for testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTimeout = errors.New("timeout")
ErrTimeout is a fake timeout error.
Functions ¶
func DataErrReader ¶
DataErrReader changes the way errors are handled by a Reader. Normally, a Reader returns an error (typically EOF) from the first Read call after the last piece of data is read. DataErrReader wraps a Reader and changes its behavior so the final error is returned along with the final data, instead of in the first call after the final data.
func HalfReader ¶
HalfReader returns a Reader that implements Read by reading half as many requested bytes from r.
func OneByteReader ¶
OneByteReader returns a Reader that implements each non-empty Read by reading one byte from r.
func TimeoutReader ¶
TimeoutReader returns ErrTimeout on the second read with no data. Subsequent calls to read succeed.
Types ¶
This section is empty.