mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
1c9b592088
Former-commit-id: a102fbb90e2a8a8b09fcb9c9e0c370e4078b74d1
23 lines
562 B
Go
23 lines
562 B
Go
package mvc
|
|
|
|
import (
|
|
"reflect"
|
|
)
|
|
|
|
var baseControllerTyp = reflect.TypeOf((*BaseController)(nil)).Elem()
|
|
|
|
func isBaseController(ctrlTyp reflect.Type) bool {
|
|
return ctrlTyp.Implements(baseControllerTyp)
|
|
}
|
|
|
|
// indirectType returns the value of a pointer-type "typ".
|
|
// If "typ" is a pointer, array, chan, map or slice it returns its Elem,
|
|
// otherwise returns the typ as it's.
|
|
func indirectType(typ reflect.Type) reflect.Type {
|
|
switch typ.Kind() {
|
|
case reflect.Ptr, reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
|
|
return typ.Elem()
|
|
}
|
|
return typ
|
|
}
|