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

Method scanValue

reader_parser.go:462–479  ·  view source on GitHub ↗

SYS-REQ-116

(retain bool)

Source from the content-addressed store, hash-verified

460
461// SYS-REQ-116
462func (rp *ReaderParser) scanValue(retain bool) error {
463 b, err := rp.peekByte(retain)
464 if err != nil {
465 if err == io.EOF {
466 return MalformedJsonError
467 }
468 return err
469 }
470
471 switch {
472 case b == '"' || (b == '\'' && rp.config.AllowSingleQuotes):
473 return rp.scanString(retain)
474 case b == '[' || b == '{':
475 return rp.scanComposite(retain, b)
476 default:
477 return rp.scanScalar(retain)
478 }
479}
480
481// SYS-REQ-116
482func (rp *ReaderParser) scanString(retain bool) error {

Callers 2

captureValueMethod · 0.95
skipValueMethod · 0.95

Calls 4

peekByteMethod · 0.95
scanStringMethod · 0.95
scanCompositeMethod · 0.95
scanScalarMethod · 0.95

Tested by

no test coverage detected