unpackValue returns values inside of non-nil interfaces when possible. This is useful for data types like structs, arrays, slices, and maps which can contain varying types packed inside an interface.
(v reflect.Value)
| 71 | // This is useful for data types like structs, arrays, slices, and maps which |
| 72 | // can contain varying types packed inside an interface. |
| 73 | func (d *dumpState) unpackValue(v reflect.Value) reflect.Value { |
| 74 | if v.Kind() == reflect.Interface && !v.IsNil() { |
| 75 | v = v.Elem() |
| 76 | } |
| 77 | return v |
| 78 | } |
| 79 | |
| 80 | // dumpPtr handles formatting of pointers by indirecting them as necessary. |
| 81 | func (d *dumpState) dumpPtr(v reflect.Value) { |