From: LE Manh Cuong Date: Fri, 10 May 2019 08:32:24 +0000 (+0700) Subject: errors: remove useless condition checking in Is X-Git-Tag: go1.13beta1~327 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c583104ee6331a6d006b493e85e0881d35164c93;p=gostls13.git 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 Reviewed-by: Brad Fitzpatrick --- 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