improved errors.Is implementation
This commit is contained in:
parent
3c49668cc9
commit
99f4cca565
5
error.go
5
error.go
@ -75,6 +75,11 @@ func (e *Error) Is(target error) bool {
|
|||||||
return tErr.tmpl == e.tmpl
|
return tErr.tmpl == e.tmpl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// target is the template itself, therefore they are considered equal to another
|
||||||
|
if tTmpl, ok := target.(*ErrTmpl); ok {
|
||||||
|
return tTmpl == e.tmpl
|
||||||
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user