improved errors.Is implementation

This commit is contained in:
Timon Ringwald 2020-10-19 11:40:45 +02:00
parent 3c49668cc9
commit 99f4cca565

View File

@ -75,6 +75,11 @@ func (e *Error) Is(target error) bool {
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
}