type-switch dispatch to the correct method given the type of 'e'
(t traversal, e Elem)
| 291 | // type-switch dispatch to the correct |
| 292 | // method given the type of 'e' |
| 293 | func next(t traversal, e Elem) { |
| 294 | switch e := e.(type) { |
| 295 | case *Map: |
| 296 | t.gMap(e) |
| 297 | case *Struct: |
| 298 | t.gStruct(e) |
| 299 | case *Slice: |
| 300 | t.gSlice(e) |
| 301 | case *Array: |
| 302 | t.gArray(e) |
| 303 | case *Ptr: |
| 304 | t.gPtr(e) |
| 305 | case *BaseElem: |
| 306 | t.gBase(e) |
| 307 | default: |
| 308 | panic("bad element type") |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | // possibly-immutable method receiver |
| 313 | func imutMethodReceiver(p Elem) string { |
no test coverage detected
searching dependent graphs…