MCPcopy Index your code
hub / github.com/expr-lang/expr / StructFields

Function StructFields

checker/nature/utils.go:170–186  ·  view source on GitHub ↗
(c *Cache, t reflect.Type)

Source from the content-addressed store, hash-verified

168}
169
170func 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
188type methodset struct {
189 rType reflect.Type

Callers 2

useMethod · 0.92
AllMethod · 0.85

Calls 3

TypeKindFunction · 0.92
getStructMethod · 0.80
structFieldMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…