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

Function FetchMethod

vm/runtime/runtime.go:151–162  ·  view source on GitHub ↗
(from any, method *Method)

Source from the content-addressed store, hash-verified

149}
150
151func FetchMethod(from any, method *Method) any {
152 v := reflect.ValueOf(from)
153 kind := v.Kind()
154 if kind != reflect.Invalid {
155 // Methods can be defined on any type, no need to dereference.
156 method := v.Method(method.Index)
157 if method.IsValid() {
158 return method.Interface()
159 }
160 }
161 panic(fmt.Sprintf("cannot fetch %v from %T", method.Name, from))
162}
163
164func Slice(array, from, to any) any {
165 v := reflect.ValueOf(array)

Callers 1

RunMethod · 0.92

Calls 2

SprintfMethod · 0.80
MethodMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…