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