1
0
mirror of https://git.zx2c4.com/wireguard-go synced 2024-11-15 09:15:14 +01:00

device: use bytes.Equal for equality check, simplify assertEqual

Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
Matt Layher 2019-06-03 16:44:06 -04:00 committed by Jason A. Donenfeld
parent 18b6627f33
commit 8d76ac8cc4

View File

@ -61,8 +61,8 @@ func assertNil(t *testing.T, err error) {
} }
} }
func assertEqual(t *testing.T, a []byte, b []byte) { func assertEqual(t *testing.T, a, b []byte) {
if bytes.Compare(a, b) != 0 { if !bytes.Equal(a, b) {
t.Fatal(a, "!=", b) t.Fatal(a, "!=", b)
} }
} }