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

Method mustReadByte

xmlparser/decoder.go:714–722  ·  view source on GitHub ↗

mustReadByte reads a single byte from the reader. 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

712// If an error occurs, it sets d.err and returns false.
713// If io.EOF is encountered, it sets d.err to a more descriptive error.
714func (d *Decoder) mustReadByte() (byte, bool) {
715 b, ok := d.readByte()
716 if !ok {
717 if errors.Is(d.err, io.EOF) {
718 d.setSyntaxErrorf("unexpected EOF")
719 }
720 }
721 return b, ok
722}
723
724// unreadByte unreads the last byte read from the reader.
725// If an error occurs, it sets d.err and returns false.

Callers 4

readStartTagMethod · 0.95
readAttrValueMethod · 0.95
readEndTagMethod · 0.95
readDoctypeMethod · 0.95

Calls 2

readByteMethod · 0.95
setSyntaxErrorfMethod · 0.95

Tested by

no test coverage detected