1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-23 03:45:56 +00:00

split the controller's method lexer and parser to another file to simplify the code, we need more steps to simplify it enough before pushing to master

Former-commit-id: ee968d822088bec428e4b7cee24ca7690d0bf504
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-12-11 06:51:52 +02:00
parent 297c581e30
commit 689b671bf9
4 changed files with 283 additions and 271 deletions

View File

@@ -2,6 +2,7 @@ package mvc2
import (
"reflect"
"strings"
"github.com/kataras/iris/context"
"github.com/kataras/pkg/zerocheck"
@@ -55,6 +56,16 @@ func equalTypes(got reflect.Type, expected reflect.Type) bool {
return false
}
func getNameOf(typ reflect.Type) string {
elemTyp := indirectTyp(typ)
typName := elemTyp.Name()
pkgPath := elemTyp.PkgPath()
fullname := pkgPath[strings.LastIndexByte(pkgPath, '/')+1:] + "." + typName
return fullname
}
func getInputArgsFromFunc(funcTyp reflect.Type) []reflect.Type {
n := funcTyp.NumIn()
funcIn := make([]reflect.Type, n, n)