This is a created article in which the information may have evolved or changed.
The trouble with reader is to remember the following:
When Read encounters a error or End-of-file condition after successfully reading n > 0 bytes, it returns the number of Bytes read. It may return the Non-nil error from the same call or return the error (and n = = 0) from a subsequent call
For write, it's simple to remember:
Write writes Len (p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= len (p)) and any error encountered this caused the write to Stop early. Write must return a non-nil error if it returns n < Len (p). Write must not modify the slice data, even temporarily.
For Bytereader: is a byte-by-byte read
Buio is the upper-level package for IO, he handles some general error situations, and so on, while reading support reads until a byte is encountered, and so on, there are other common features.