mustReadUntil reads bytes to the buffer until the specified delimiter byte is encountered. The delimiter byte is included in the buffer. If an error occurs, it sets d.err and returns false. If io.EOF is encountered, it sets d.err to a more descriptive error.
(delim byte)
| 768 | // If an error occurs, it sets d.err and returns false. |
| 769 | // If io.EOF is encountered, it sets d.err to a more descriptive error. |
| 770 | func (d *Decoder) mustReadUntil(delim byte) bool { |
| 771 | if !d.readUntil(delim) { |
| 772 | if errors.Is(d.err, io.EOF) { |
| 773 | d.setSyntaxErrorf("unexpected EOF") |
| 774 | } |
| 775 | return false |
| 776 | } |
| 777 | return true |
| 778 | } |
| 779 | |
| 780 | // mustReadWhileFn reads bytes to the buffer while the provided function returns true. |
| 781 | // The byte that causes the function to return false is not included in the buffer. |
no test coverage detected