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{}.
()
| 406 | // If it finds anything other than a quoted string literal or null, |
| 407 | // valueQuoted returns unquotedValue{}. |
| 408 | func (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. |
no test coverage detected