mirror of
https://github.com/kataras/iris.git
synced 2026-01-27 05:45:56 +00:00
add support for mvc and hero dynamic dependencies to understand the error type as a second output value as requested at: https://github.com/kataras/iris/issues/1187
Former-commit-id: 49e29c06aaaa22743354981342c29fc9d5953d0e
This commit is contained in:
@@ -59,6 +59,13 @@ func IsZero(v reflect.Value) bool {
|
||||
return v.Interface() == zero.Interface()
|
||||
}
|
||||
|
||||
var errTyp = reflect.TypeOf((*error)(nil)).Elem()
|
||||
|
||||
// IsError returns true if "typ" is type of `error`.
|
||||
func IsError(typ reflect.Type) bool {
|
||||
return typ.Implements(errTyp)
|
||||
}
|
||||
|
||||
// IndirectValue returns the reflect.Value that "v" points to.
|
||||
// If "v" is a nil pointer, Indirect returns a zero Value.
|
||||
// If "v" is not a pointer, Indirect returns v.
|
||||
|
||||
Reference in New Issue
Block a user