peek peeks at the next n bytes without advancing the reader. If an error occurs, it sets d.err and returns false.
(n int)
| 814 | // peek peeks at the next n bytes without advancing the reader. |
| 815 | // If an error occurs, it sets d.err and returns false. |
| 816 | func (d *Decoder) peek(n int) ([]byte, bool) { |
| 817 | b, err := d.r.Peek(n) |
| 818 | if err != nil { |
| 819 | d.err = err |
| 820 | return nil, false |
| 821 | } |
| 822 | return b, true |
| 823 | } |
| 824 | |
| 825 | // mustPeek peeks at the next n bytes without advancing the reader. |
| 826 | // If an error occurs, it sets d.err and returns false. |