aboutsummaryrefslogtreecommitdiff
path: root/src/errors/wrap.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors/wrap.go')
-rw-r--r--src/errors/wrap.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/errors/wrap.go b/src/errors/wrap.go
index 04ddf79ba3..69dd9464ec 100644
--- a/src/errors/wrap.go
+++ b/src/errors/wrap.go
@@ -51,8 +51,10 @@ func Is(err, target error) bool {
if target == nil {
return err == target
}
+
+ isComparable := target == nil || reflectlite.TypeOf(target).Comparable()
for {
- if err == target {
+ if isComparable && err == target {
return true
}
if x, ok := err.(interface{ Is(error) bool }); ok && x.Is(target) {