(v reflect.Value, index []int)
| 195 | } |
| 196 | |
| 197 | func (e *encoder) fieldByIndex(v reflect.Value, index []int) (field reflect.Value) { |
| 198 | for _, num := range index { |
| 199 | for { |
| 200 | if v.Kind() == reflect.Ptr { |
| 201 | if v.IsNil() { |
| 202 | return reflect.Value{} |
| 203 | } |
| 204 | v = v.Elem() |
| 205 | continue |
| 206 | } |
| 207 | break |
| 208 | } |
| 209 | v = v.Field(num) |
| 210 | } |
| 211 | return v |
| 212 | } |
| 213 | |
| 214 | func (e *encoder) structv(tag string, in reflect.Value) { |
| 215 | sinfo, err := getStructInfo(in.Type()) |