(rt reflect.Type)
| 120 | } |
| 121 | |
| 122 | func allFields(rt reflect.Type) []reflect.StructField { |
| 123 | fields := make([]reflect.StructField, 0, rt.NumField()) |
| 124 | for i := 0; i < rt.NumField(); i++ { |
| 125 | field := rt.Field(i) |
| 126 | if field.Anonymous && field.Type.Kind() == reflect.Struct { |
| 127 | // Recurse into anonymous struct fields. |
| 128 | fields = append(fields, allFields(field.Type)...) |
| 129 | continue |
| 130 | } |
| 131 | fields = append(fields, rt.Field(i)) |
| 132 | } |
| 133 | return fields |
| 134 | } |
no outgoing calls
no test coverage detected