MCPcopy Create free account
hub / github.com/araddon/qlbridge / evalCall

Method evalCall

datasource/context_wrapper.go:208–222  ·  view source on GitHub ↗
(dot, fun reflect.Value, node expr.Node, name string, args []expr.Node, final reflect.Value)

Source from the content-addressed store, hash-verified

206}
207
208func (s *state) evalCall(dot, fun reflect.Value, node expr.Node, name string, args []expr.Node, final reflect.Value) reflect.Value {
209 typ := fun.Type()
210 if !goodFunc(typ) {
211 // TODO: This could still be a confusing error; maybe goodFunc should provide info.
212 return s.errorf("can't call method/function %q with %d results", name, typ.NumOut())
213 }
214 // Build the arg list.
215 argv := make([]reflect.Value, 0)
216 result := fun.Call(argv)
217 // If we have an error that is not nil, stop execution and return that error to the caller.
218 if len(result) == 2 && !result[1].IsNil() {
219 return s.errorf("error calling %s: %s", name, result[1].Interface().(error))
220 }
221 return result[0]
222}
223
224/*
225// evalCall executes a function or method call. If it's a method, fun already has the receiver bound, so

Callers 1

evalFieldMethod · 0.95

Calls 3

errorfMethod · 0.95
goodFuncFunction · 0.85
TypeMethod · 0.65

Tested by

no test coverage detected