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

Method mustReadUntil

xmlparser/decoder.go:770–778  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
770func (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.

Callers 4

readAttrValueMethod · 0.95
readProcInstMethod · 0.95
readCommentMethod · 0.95
readCDataMethod · 0.95

Calls 2

readUntilMethod · 0.95
setSyntaxErrorfMethod · 0.95

Tested by

no test coverage detected