From: Matt Layher Date: Mon, 3 Jun 2019 20:44:06 +0000 (-0400) Subject: device: use bytes.Equal for equality check, simplify assertEqual X-Git-Tag: 0.0.20190805~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d76ac8cc47cbe4072b2f5a48ede21c3e2d5ced0;p=thirdparty%2Fwireguard-go.git device: use bytes.Equal for equality check, simplify assertEqual Signed-off-by: Matt Layher --- diff --git a/device/device_test.go b/device/device_test.go index b6212b5..cdbd458 100644 --- a/device/device_test.go +++ b/device/device_test.go @@ -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) } }