chore: bytes.Equal instead bytes.Compare

This commit is contained in:
guoguangwu 2023-07-14 21:56:39 +08:00
parent 4f12a4f308
commit 3b08d7b8a2

View File

@ -208,7 +208,7 @@ func TestWriteTo(t *testing.T) {
t.Fatal("WriteTo nw mismatch", nw)
}
if bytes.Compare(sndbuf, rcvbuf.Bytes()) != 0 {
if !bytes.Equal(sndbuf, rcvbuf.Bytes()) {
t.Fatal("mismatched echo bytes")
}
}
@ -282,7 +282,7 @@ func TestWriteToV2(t *testing.T) {
t.Fatal("WriteTo nw mismatch", nw)
}
if bytes.Compare(sndbuf, rcvbuf.Bytes()) != 0 {
if !bytes.Equal(sndbuf, rcvbuf.Bytes()) {
t.Fatal("mismatched echo bytes")
}
}