Is makes the Error implement error comparison.
(target error)
| 35 | |
| 36 | // Is makes the Error implement error comparison. |
| 37 | func (e *Error) Is(target error) bool { |
| 38 | if e == nil { |
| 39 | return target == nil |
| 40 | } |
| 41 | if namedErr := (interface { |
| 42 | Namespace() string |
| 43 | Name() string |
| 44 | })(nil); errors.As(target, &namedErr) { |
| 45 | return namedErr.Namespace() == e.Namespace() && |
| 46 | namedErr.Name() == e.Name() |
| 47 | } |
| 48 | return false |
| 49 | } |
| 50 | |
| 51 | // Unwrap makes the Definition implement error unwrapping. |
| 52 | func (*Definition) Unwrap() error { |