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

Function ExamplePointer_Get

examples_test.go:71–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69}
70
71func ExamplePointer_Get() {
72 var doc exampleDocument
73
74 if err := json.Unmarshal(testDocumentJSONBytes, &doc); err != nil { // populates doc
75 fmt.Println(err)
76
77 return
78 }
79
80 pointer, err := New("/foo/1")
81 if err != nil {
82 fmt.Println(err)
83
84 return
85 }
86
87 value, kind, err := pointer.Get(doc)
88 if err != nil {
89 fmt.Println(err)
90
91 return
92 }
93
94 fmt.Printf(
95 "value: %q\nkind: %v\n",
96 value, kind,
97 )
98
99 // Output:
100 // value: "baz"
101 // kind: string
102}
103
104func ExamplePointer_Set() {
105 var doc exampleDocument

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
GetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…