MCPcopy Create free account
hub / github.com/blues/note / valueQuoted

Method valueQuoted

jsonxt/decode.go:408–425  ·  view source on GitHub ↗

valueQuoted is like value but decodes a quoted string literal or literal null into an interface value. If it finds anything other than a quoted string literal or null, valueQuoted returns unquotedValue{}.

()

Source from the content-addressed store, hash-verified

406// If it finds anything other than a quoted string literal or null,
407// valueQuoted returns unquotedValue{}.
408func (d *decodeState) valueQuoted() interface{} {
409 switch d.opcode {
410 default:
411 panic(phasePanicMsg)
412
413 case scanBeginArray, scanBeginObject:
414 d.skip()
415 d.scanNext()
416
417 case scanBeginLiteral:
418 v := d.literalInterface()
419 switch v.(type) {
420 case nil, string:
421 return v
422 }
423 }
424 return unquotedValue{}
425}
426
427// indirect walks down v allocating pointers as needed,
428// until it gets to a non-pointer.

Callers 1

objectMethod · 0.95

Calls 3

skipMethod · 0.95
scanNextMethod · 0.95
literalInterfaceMethod · 0.95

Tested by

no test coverage detected