JSONLookup implements an interface to customize json pointer lookup.
(token string, data any)
| 671 | |
| 672 | // JSONLookup implements an interface to customize json pointer lookup. |
| 673 | func (s *settableColl) JSONSet(token string, data any) error { |
| 674 | if _, err := strconv.Atoi(token); err == nil { |
| 675 | _, err := SetForToken(s.Items, token, data) |
| 676 | return err |
| 677 | } |
| 678 | return fmt.Errorf("%s is not a valid index: %w", token, ErrPointer) |
| 679 | } |
| 680 | |
| 681 | type settableCollItem struct { |
| 682 | B int `json:"b"` |
nothing calls this directly
no test coverage detected