aboutsummaryrefslogtreecommitdiff
path: root/src/errors
diff options
context:
space:
mode:
authorLE Manh Cuong <cuong.manhle.vn@gmail.com>2019-05-10 15:32:24 +0700
committerBrad Fitzpatrick <bradfitz@golang.org>2019-05-13 13:54:54 +0000
commitc583104ee6331a6d006b493e85e0881d35164c93 (patch)
tree5aa558085d55bbcf2c3d39e5b7e6b54e13fc8fa9 /src/errors
parentafd79150d99abe06bd56870f146842f77f279d6d (diff)
downloadgo-c583104ee6331a6d006b493e85e0881d35164c93.tar.gz
go-c583104ee6331a6d006b493e85e0881d35164c93.zip
errors: remove useless condition checking in Is
golang.org/cl/175260 fixed Is panics if target is uncomparable. It did add an useless condition checking whether target is comparable. Just remove that condition. Change-Id: I0a317056479638d209b0a0cbc7010c153558c087 Reviewed-on: https://go-review.googlesource.com/c/go/+/176497 Reviewed-by: Joan Lopez de la Franca Beltran <joanjan14@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/errors')
-rw-r--r--src/errors/wrap.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/errors/wrap.go b/src/errors/wrap.go
index 69dd9464ec..b53caa6fc9 100644
--- a/src/errors/wrap.go
+++ b/src/errors/wrap.go
@@ -52,7 +52,7 @@ func Is(err, target error) bool {
return err == target
}
- isComparable := target == nil || reflectlite.TypeOf(target).Comparable()
+ isComparable := reflectlite.TypeOf(target).Comparable()
for {
if isComparable && err == target {
return true