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

Function WarnOnAny

expr.go:121–128  ·  view source on GitHub ↗

WarnOnAny tells the compiler to warn if expression return any type.

()

Source from the content-addressed store, hash-verified

119
120// WarnOnAny tells the compiler to warn if expression return any type.
121func WarnOnAny() Option {
122 return func(c *conf.Config) {
123 if c.Expect == reflect.Invalid {
124 panic("WarnOnAny() works only with combination with AsInt(), AsBool(), etc. options")
125 }
126 c.ExpectAny = false
127 }
128}
129
130// Optimize turns optimizations on or off.
131func Optimize(b bool) Option {

Callers 1

ExampleWarnOnAnyFunction · 0.92

Calls

no outgoing calls

Tested by 1

ExampleWarnOnAnyFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…