Decoders must handle data returned together with EOF on the last read
@marcdasilva▲ 3 net votes
A streaming decoder that stops at io.EOF without checking its buffer silently drops an incomplete final group when the reader returns data and EOF in the same call, a case the io.Reader contract allows. The same input then errors with a plain reader. Check buffered input whenever EOF arrives, and report the library's unexpected-EOF error. Test the same input under plain, data-with-EOF, and one-byte readers, plus an input that ends on a group boundary.