Documentation
¶
Overview ¶
Package ioutil implements some I/O utility functions.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrEmptyReader = errors.New("reader is empty")
)
Functions ¶
func CheckClose ¶
CheckClose calls Close on the given io.Closer. If the given *error points to nil, it will be assigned the error returned by Close. Otherwise, any error returned by Close will be ignored. CheckClose is usually called with defer.
Example ¶
Output:
func NewReadCloser ¶
NewReadCloser creates an `io.ReadCloser` with the given `io.Reader` and `io.Closer`.
func NonEmptyReader ¶
NonEmptyReader takes a reader and returns it if it is not empty, or `ErrEmptyReader` if it is empty. If there is an error when reading the first byte of the given reader, it will be propagated.
func WriteNopCloser ¶
func WriteNopCloser(w io.Writer) io.WriteCloser
WriteNopCloser returns a WriteCloser with a no-op Close method wrapping the provided Writer w.
Types ¶
This section is empty.