Skip to content

Commit

Permalink
Avoid type assertion to the same type
Browse files Browse the repository at this point in the history
  • Loading branch information
xhit committed May 27, 2021
1 parent 2da6713 commit fa7ae67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion error.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func (cn *conn) errRecover(err *error) {
cn.setBad()
*err = driver.ErrBadConn
case error:
if v == io.EOF || v.(error).Error() == "remote error: handshake failure" {
if v == io.EOF || v.Error() == "remote error: handshake failure" {
*err = driver.ErrBadConn
} else {
*err = v
Expand Down

0 comments on commit fa7ae67

Please sign in to comment.