package
1.24.4
Repository: https://pkg.go.dev/std
Documentation: pkg.go.dev

# Functions

DataErrReader changes the way errors are handled by a Reader.
ErrReader returns an [io.Reader] that returns 0, err from all Read calls.
HalfReader returns a Reader that implements Read by reading half as many requested bytes from r.
NewReadLogger returns a reader that behaves like r except that it logs (using [log.Printf]) each read to standard error, printing the prefix and the hexadecimal data read.
NewWriteLogger returns a writer that behaves like w except that it logs (using [log.Printf]) each write to standard error, printing the prefix and the hexadecimal data written.
OneByteReader returns a Reader that implements each non-empty Read by reading one byte from r.
TestReader tests that reading from r returns the expected file content.
TimeoutReader returns [ErrTimeout] on the second read with no data.
TruncateWriter returns a Writer that writes to w but stops silently after n bytes.

# Variables

ErrTimeout is a fake timeout error.