MCPcopy Index your code
hub / github.com/go-openapi/jsonpointer / JSONSet

Method JSONSet

pointer_test.go:673–679  ·  view source on GitHub ↗

JSONLookup implements an interface to customize json pointer lookup.

(token string, data any)

Source from the content-addressed store, hash-verified

671
672// JSONLookup implements an interface to customize json pointer lookup.
673func (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
681type settableCollItem struct {
682 B int `json:"b"`

Callers

nothing calls this directly

Calls 1

SetForTokenFunction · 0.85

Tested by

no test coverage detected