mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 11:57:02 +00:00
I, think, that binders are done, both dynamic functions with different results every time (based on the context) and static services (interface as input(to give the devs the chance make better and most testable code) and struct or both are structs)
Former-commit-id: eb395b06003ea9eae005a36c9c6be0ef63c4d41d
This commit is contained in:
@@ -32,3 +32,15 @@ func goodVal(v reflect.Value) bool {
|
||||
func isFunc(typ reflect.Type) bool {
|
||||
return typ.Kind() == reflect.Func
|
||||
}
|
||||
|
||||
func equalTypes(in reflect.Type, v reflect.Type) bool {
|
||||
if in == v {
|
||||
return true
|
||||
}
|
||||
// if accepts an interface, check if the given "v" type does
|
||||
// implement this.
|
||||
if in.Kind() == reflect.Interface {
|
||||
return v.Implements(in)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user