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

Function checkFunc

patcher/operator_override.go:139–148  ·  view source on GitHub ↗
(fn *builtin.Function, name string, operator string)

Source from the content-addressed store, hash-verified

137}
138
139func checkFunc(fn *builtin.Function, name string, operator string) {
140 if len(fn.Types) == 0 {
141 panic(fmt.Errorf("function %q for %q operator misses types", name, operator))
142 }
143 for _, t := range fn.Types {
144 if t.NumIn() != 2 || t.NumOut() != 1 {
145 panic(fmt.Errorf("function %q for %q operator does not have a correct signature", name, operator))
146 }
147 }
148}

Callers 1

CheckMethod · 0.85

Calls 3

NumInMethod · 0.80
NumOutMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…