p2p: use errors.Is for error comparison (#24882)

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
Håvard Anda Estensen
2022-06-07 17:27:21 +02:00
committed by GitHub
co-authored by Felix Lange
parent 41e75480df
commit 138f0d7494
9 changed files with 24 additions and 13 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ func discReasonForError(err error) DiscReason {
if reason, ok := err.(DiscReason); ok {
return reason
}
if err == errProtocolReturned {
if errors.Is(err, errProtocolReturned) {
return DiscQuitting
}
peerError, ok := err.(*peerError)