(c *Cache, t reflect.Type)
| 168 | } |
| 169 | |
| 170 | func StructFields(c *Cache, t reflect.Type) map[string]Nature { |
| 171 | table := make(map[string]Nature) |
| 172 | if t == nil { |
| 173 | return table |
| 174 | } |
| 175 | t, k, _ := deref.TypeKind(t, t.Kind()) |
| 176 | if k == reflect.Struct { |
| 177 | // lookup for a field with an empty name, which will cause to never find a |
| 178 | // match, meaning everything will have been cached. |
| 179 | sd := c.getStruct(t).structData |
| 180 | sd.structField(c, nil, "") |
| 181 | for name, sf := range sd.fields { |
| 182 | table[name] = sf.Nature |
| 183 | } |
| 184 | } |
| 185 | return table |
| 186 | } |
| 187 | |
| 188 | type methodset struct { |
| 189 | rType reflect.Type |
no test coverage detected
searching dependent graphs…