()
| 176 | } |
| 177 | |
| 178 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…