MCPcopy Create free account
hub / github.com/buger/jsonparser / captureValue

Method captureValue

reader_parser.go:438–454  ·  view source on GitHub ↗

SYS-REQ-116

()

Source from the content-addressed store, hash-verified

436
437// SYS-REQ-116
438func (rp *ReaderParser) captureValue() ([]byte, error) {
439 if err := rp.skipWhitespace(); err != nil {
440 if err == io.EOF {
441 return nil, MalformedJsonError
442 }
443 return nil, err
444 }
445
446 // Retain only this value and any already-read suffix. The suffix is at most
447 // one read chunk; prefixes consumed while locating the value are released.
448 rp.discardConsumed()
449 start := rp.pos
450 if err := rp.scanValue(true); err != nil {
451 return nil, err
452 }
453 return rp.buf[start:rp.pos], nil
454}
455
456// SYS-REQ-116
457func (rp *ReaderParser) skipValue() error {

Callers 3

GetMethod · 0.95
ArrayEachMethod · 0.95
findValueMethod · 0.95

Calls 3

skipWhitespaceMethod · 0.95
discardConsumedMethod · 0.95
scanValueMethod · 0.95

Tested by

no test coverage detected