MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / mustPeekBuffered

Method mustPeekBuffered

xmlparser/decoder.go:842–845  ·  view source on GitHub ↗

mustPeekBuffered peeks at all currently buffered bytes without advancing the reader. If no bytes are buffered, it peeks at least 1 byte. 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.

()

Source from the content-addressed store, hash-verified

840// If an error occurs, it sets d.err and returns false.
841// If io.EOF is encountered, it sets d.err to a more descriptive error.
842func (d *Decoder) mustPeekBuffered() ([]byte, bool) {
843 toPeek := max(d.r.Buffered(), 1)
844 return d.mustPeek(toPeek)
845}
846
847// discard discards the next n bytes from the reader.
848func (d *Decoder) discard(n int) bool {

Callers 2

skipSpacesMethod · 0.95
mustReadWhileFnMethod · 0.95

Calls 1

mustPeekMethod · 0.95

Tested by

no test coverage detected