Set uses the pointer to set a value from a data type that represent a JSON document. # Mutation contract Set mutates the provided document in place whenever Go's type system allows it: when document is a map, a pointer, or when the targeted value is reached through an addressable ancestor (e.g. a
(document any, value any, opts ...Option)
| 83 | // |
| 84 | // See [ErrDashToken] for the semantics of the "-" token. |
| 85 | func (p *Pointer) Set(document any, value any, opts ...Option) (any, error) { |
| 86 | o := optionsWithDefaults(opts) |
| 87 | |
| 88 | return p.set(document, value, o.provider) |
| 89 | } |
| 90 | |
| 91 | // DecodedTokens returns the decoded (unescaped) tokens of this JSON pointer. |
| 92 | func (p *Pointer) DecodedTokens() []string { |