From e373054f7e0d33da117d86ae91bfee0a59d52ba5 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Wed, 3 Jun 2020 11:11:25 +0200 Subject: [PATCH] Use bytes.Equal in packetcache_test.go. --- packetcache/packetcache_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packetcache/packetcache_test.go b/packetcache/packetcache_test.go index fd3ffc6..2119bf1 100644 --- a/packetcache/packetcache_test.go +++ b/packetcache/packetcache_test.go @@ -26,20 +26,20 @@ func TestCache(t *testing.T) { buf := make([]byte, BufSize) l := cache.Get(13, buf) - if bytes.Compare(buf[:l], buf1) != 0 { + if !bytes.Equal(buf[:l], buf1) { t.Errorf("Couldn't get 13") } l = cache.GetAt(13, i1, buf) - if bytes.Compare(buf[:l], buf1) != 0 { + if !bytes.Equal(buf[:l], buf1) { t.Errorf("Couldn't get 13 at %v", i1) } l = cache.Get(17, buf) - if bytes.Compare(buf[:l], buf2) != 0 { + if !bytes.Equal(buf[:l], buf2) { t.Errorf("Couldn't get 17") } l = cache.GetAt(17, i2, buf) - if bytes.Compare(buf[:l], buf2) != 0 { + if !bytes.Equal(buf[:l], buf2) { t.Errorf("Couldn't get 17 at %v", i2) }