This lesson provides necessary information about the bytes package provided by Golang.
The bytes
package
Slices of bytes are so common that Go has a bytes
package with manipulation functions for that kind of type. It is very analogous to the strings package. Moreover, it contains a very handy type Buffer
:
import "bytes"
type Buffer struct {
...
}
It is a variable-sized buffer of bytes with Read
and Write
methods because reading and writing an unknown number of bytes is best done buffered. ...