byte slice

A Go slice of bytes, the raw form data takes when it is read from or written to files, networks and encoders.

In more detail

os.ReadFile, io.ReadAll and json.Marshal all return a []byte. Convert it to text with string(data) and back with []byte("text"). Byte counts from len tell you how much data you have.

Example

conf := []byte("interval=30s\n")

Related terms

Taught in

References