]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
device: use bytes.Equal for equality check, simplify assertEqual
authorMatt Layher <mdlayher@gmail.com>
Mon, 3 Jun 2019 20:44:06 +0000 (16:44 -0400)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 4 Jun 2019 11:01:52 +0000 (13:01 +0200)
Signed-off-by: Matt Layher <mdlayher@gmail.com>
device/device_test.go

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