io package

Go's standard library package of small interfaces and helpers for moving streams of bytes, centred on io.Reader and io.Writer.

In more detail

Files, network connections, HTTP bodies and in-memory buffers all satisfy these interfaces, so one function can work with any of them. Helpers such as io.Copy, io.ReadAll, io.LimitReader and io.ReadFull build on them.

Example

import "io"

Related terms

Taught in

References