MCPcopy
hub / github.com/expr-lang/expr / init

Function init

test/gen/gen.go:52–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50)
51
52func init() {
53 for name, x := range Env {
54 dict = append(dict, name)
55 v := reflect.ValueOf(x)
56 if v.Kind() == reflect.Struct {
57 for i := 0; i < v.NumField(); i++ {
58 dict = append(dict, v.Type().Field(i).Name)
59 }
60 for i := 0; i < v.NumMethod(); i++ {
61 dict = append(dict, v.Type().Method(i).Name)
62 }
63 }
64 if v.Kind() == reflect.Map {
65 for _, key := range v.MapKeys() {
66 dict = append(dict, fmt.Sprintf("%v", key.Interface()))
67 }
68 }
69 }
70 for _, b := range builtin.Builtins {
71 if b.Predicate {
72 predicates = append(predicates, b.Name)
73 } else {
74 builtins = append(builtins, b.Name)
75 }
76 }
77}
78
79func main() {
80 runtime.GOMAXPROCS(runtime.NumCPU())

Callers

nothing calls this directly

Calls 3

SprintfMethod · 0.80
TypeMethod · 0.65
MethodMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…