(v reflect.Value, field *Field)
| 126 | } |
| 127 | |
| 128 | func fieldByIndex(v reflect.Value, field *Field) reflect.Value { |
| 129 | if len(field.Index) == 1 { |
| 130 | return v.Field(field.Index[0]) |
| 131 | } |
| 132 | for i, x := range field.Index { |
| 133 | if i > 0 { |
| 134 | if v.Kind() == reflect.Ptr { |
| 135 | if v.IsNil() { |
| 136 | panic(fmt.Sprintf("cannot get %v from %v", field.Path[i], field.Path[i-1])) |
| 137 | } |
| 138 | v = v.Elem() |
| 139 | } |
| 140 | } |
| 141 | v = v.Field(x) |
| 142 | } |
| 143 | return v |
| 144 | } |
| 145 | |
| 146 | type Method struct { |
| 147 | Index int |
no test coverage detected
searching dependent graphs…