(key string)
| 613 | } |
| 614 | |
| 615 | func (j *jsonEncoded) FetchValKeyOrIdx(key string) (JSON, error) { |
| 616 | switch j.typ { |
| 617 | case ObjectJSONType: |
| 618 | return j.FetchValKey(key) |
| 619 | case ArrayJSONType: |
| 620 | idx, err := strconv.Atoi(key) |
| 621 | if err != nil { |
| 622 | // We shouldn't return this error because it means we couldn't parse the |
| 623 | // number, meaning it was a string and that just means we can't find the |
| 624 | // value in an array. |
| 625 | return nil, nil //nolint:returnerrcheck |
| 626 | } |
| 627 | return j.FetchValIdx(idx) |
| 628 | } |
| 629 | return nil, nil |
| 630 | } |
| 631 | |
| 632 | func (j *jsonEncoded) Format(buf *bytes.Buffer) { |
| 633 | decoded, err := j.decode() |
nothing calls this directly
no test coverage detected