p2p: use errors.Is instead of reflect.DeepEqual for error comparison

This commit is contained in:
Vansh Sahay 2026-06-19 12:35:52 +05:30
parent 17fcefa1c4
commit 4e49b437e3
No known key found for this signature in database

View file

@ -147,7 +147,7 @@ func TestProtocolHandshakeErrors(t *testing.T) {
p1, p2 := MsgPipe()
go Send(p1, test.code, test.msg)
_, err := readProtocolHandshake(p2)
if !reflect.DeepEqual(err, test.err) {
if !errors.Is(err, test.err) {
t.Errorf("test %d: error mismatch: got %q, want %q", i, err, test.err)
}
}