From 8d76ac8cc47cbe4072b2f5a48ede21c3e2d5ced0 Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Mon, 3 Jun 2019 16:44:06 -0400 Subject: device: use bytes.Equal for equality check, simplify assertEqual Signed-off-by: Matt Layher --- device/device_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'device') 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) } } -- cgit v1.2.3