Commit c583104e authored by LE Manh Cuong's avatar LE Manh Cuong Committed by Brad Fitzpatrick

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/+/176497Reviewed-by: default avatarJoan Lopez de la Franca Beltran <joanjan14@gmail.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent afd79150
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment