(key string)
| 627 | } |
| 628 | |
| 629 | func (j *jsonEncoded) FetchValKeyOrIdx(key string) (JSON, error) { |
| 630 | switch j.typ { |
| 631 | case ObjectJSONType: |
| 632 | return j.FetchValKey(key) |
| 633 | case ArrayJSONType: |
| 634 | idx, err := strconv.Atoi(key) |
| 635 | if err != nil { |
| 636 | // We shouldn't return this error because it means we couldn't parse the |
| 637 | // number, meaning it was a string and that just means we can't find the |
| 638 | // value in an array. |
| 639 | return nil, nil //nolint:returnerrcheck |
| 640 | } |
| 641 | return j.FetchValIdx(idx) |
| 642 | } |
| 643 | return nil, nil |
| 644 | } |
| 645 | |
| 646 | func (j *jsonEncoded) Format(buf *bytes.Buffer) { |
| 647 | decoded, err := j.decode() |
nothing calls this directly
no test coverage detected