iris/mvc/activator/methodfunc/func_caller.go
Gerasimos (Makis) Maropoulos 49ee8f2d75 Update to version 8.5.0 | NEW: MVC Output Result | Read HISTORY.md
Former-commit-id: 6a3579f2500fc715d7dc606478960946dcade61d
2017-10-09 15:26:46 +03:00

20 lines
634 B
Go

package methodfunc
import (
"reflect"
"github.com/kataras/iris/context"
)
// buildMethodCall builds the method caller.
// We have repeated code here but it's the only way
// to support more than one input arguments without performance cost compared to previous implementation.
// so it's hard-coded written to check the length of input args and their types.
func buildMethodCall(a *ast) func(ctx context.Context, f reflect.Value) {
// if func input arguments are more than one then
// use the Call method (slower).
return func(ctx context.Context, f reflect.Value) {
DispatchFuncResult(ctx, f.Call(a.paramValues(ctx)))
}
}