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

Function CreateNew

conf/config.go:47–61  ·  view source on GitHub ↗

CreateNew creates new config with default values.

()

Source from the content-addressed store, hash-verified

45
46// CreateNew creates new config with default values.
47func CreateNew() *Config {
48 c := &Config{
49 Optimize: true,
50 ShortCircuit: true,
51 MaxNodes: DefaultMaxNodes,
52 ConstFns: make(map[string]reflect.Value),
53 Functions: make(map[string]*builtin.Function),
54 Builtins: make(map[string]*builtin.Function),
55 Disabled: make(map[string]bool),
56 }
57 for _, f := range builtin.Builtins {
58 c.Builtins[f.Name] = f
59 }
60 return c
61}
62
63// New creates new config with environment.
64func New(env any) *Config {

Callers 10

CompileFunction · 0.92
TestCheck_NoConfigFunction · 0.92
TestNodeBudgetFunction · 0.92
TestNodeBudgetDisabledFunction · 0.92
TestTimeFunction · 0.92
TestRun_HelpersFunction · 0.92
NewFunction · 0.85

Calls

no outgoing calls

Tested by 8

TestCheck_NoConfigFunction · 0.74
TestNodeBudgetFunction · 0.74
TestNodeBudgetDisabledFunction · 0.74
TestTimeFunction · 0.74
TestRun_HelpersFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…