MCPcopy Create free account
hub / github.com/cloudwego/dynamicgo / ExamplePathNode_Load

Function ExamplePathNode_Load

thrift/generic/example_test.go:178–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176}
177
178func ExamplePathNode_Load() {
179 // make root PathNode
180 data := getExampleData()
181 root := PathNode{
182 Node: NewNode(thrift.STRUCT, data),
183 }
184
185 // load first level children
186 err := root.Load(false, opts)
187 if err != nil {
188 panic(err)
189 }
190 fmt.Printf("%#v", root)
191
192 // load all level children
193 err = root.Load(true, opts)
194 if err != nil {
195 panic(err)
196 }
197 fmt.Printf("%#v", root)
198
199 // reuse PathNode memory
200 reuse := pathNodePool.Get().(*PathNode)
201 root.Node = NewNode(thrift.STRUCT, data)
202 err = root.Load(true, opts)
203 if err != nil {
204 panic(err)
205 }
206 fmt.Printf("%#v", root)
207 reuse.ResetValue()
208 pathNodePool.Put(reuse)
209
210}

Callers

nothing calls this directly

Calls 5

LoadMethod · 0.95
getExampleDataFunction · 0.70
NewNodeFunction · 0.70
GetMethod · 0.45
ResetValueMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…