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

Method trySet

checker/nature/utils.go:156–168  ·  view source on GitHub ↗
(name string, sf *structField)

Source from the content-addressed store, hash-verified

154}
155
156func (s *structData) trySet(name string, sf *structField) {
157 if _, ok := s.fields[name]; ok {
158 return
159 }
160 sf = &structField{
161 Nature: sf.Nature,
162 Index: append(s.curChildIndex, sf.Index...),
163 }
164 s.fields[name] = sf
165 if s.curParent != nil {
166 s.curParent.trySet(name, sf)
167 }
168}
169
170func StructFields(c *Cache, t reflect.Type) map[string]Nature {
171 table := make(map[string]Nature)

Callers 2

findInEmbeddedMethod · 0.95
structFieldMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected