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

Function ExamplePathNode_Load

proto/generic/example_test.go:173–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

LoadMethod · 0.95
getExample3DescFunction · 0.85
getExample3DataFunction · 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…