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

Method Set

pointer.go:85–89  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

83//
84// See [ErrDashToken] for the semantics of the "-" token.
85func (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.
92func (p *Pointer) DecodedTokens() []string {

Callers 14

ExamplePointer_SetFunction · 0.80
Example_ifaceFunction · 0.80
TestStructFunction · 0.80
TestSetNodeFunction · 0.80
TestEdgeCasesFunction · 0.80
TestDashToken_SetAppendFunction · 0.80
TestDashToken_SetErrorsFunction · 0.80

Calls 2

setMethod · 0.95
optionsWithDefaultsFunction · 0.85

Tested by 12

ExamplePointer_SetFunction · 0.64
Example_ifaceFunction · 0.64
TestStructFunction · 0.64
TestSetNodeFunction · 0.64
TestEdgeCasesFunction · 0.64
TestDashToken_SetAppendFunction · 0.64
TestDashToken_SetErrorsFunction · 0.64