From 91b385db444376f4309468ee207db596a2f8e56c Mon Sep 17 00:00:00 2001 From: beorn7 Date: Sat, 5 Jan 2019 22:11:07 +0100 Subject: [PATCH] Fix staticcheck errors in push_test.go Signed-off-by: beorn7 --- prometheus/push/push_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/prometheus/push/push_test.go b/prometheus/push/push_test.go index 34ec334..5e19f39 100644 --- a/prometheus/push/push_test.go +++ b/prometheus/push/push_test.go @@ -96,7 +96,7 @@ func TestPush(t *testing.T) { if lastMethod != "PUT" { t.Error("want method PUT for Push, got", lastMethod) } - if bytes.Compare(lastBody, wantBody) != 0 { + if !bytes.Equal(lastBody, wantBody) { t.Errorf("got body %v, want %v", lastBody, wantBody) } if lastPath != "/metrics/job/testjob" { @@ -113,7 +113,7 @@ func TestPush(t *testing.T) { if lastMethod != "POST" { t.Error("want method POST for Add, got", lastMethod) } - if bytes.Compare(lastBody, wantBody) != 0 { + if !bytes.Equal(lastBody, wantBody) { t.Errorf("got body %v, want %v", lastBody, wantBody) } if lastPath != "/metrics/job/testjob" { @@ -170,7 +170,7 @@ func TestPush(t *testing.T) { if lastMethod != "PUT" { t.Error("want method PUT for Push, got", lastMethod) } - if bytes.Compare(lastBody, wantBody) != 0 { + if !bytes.Equal(lastBody, wantBody) { t.Errorf("got body %v, want %v", lastBody, wantBody) } @@ -185,7 +185,7 @@ func TestPush(t *testing.T) { if lastMethod != "POST" { t.Error("want method POST for Add, got", lastMethod) } - if bytes.Compare(lastBody, wantBody) != 0 { + if !bytes.Equal(lastBody, wantBody) { t.Errorf("got body %v, want %v", lastBody, wantBody) } if lastPath != "/metrics/job/testjob/a/x/b/y" && lastPath != "/metrics/job/testjob/b/y/a/x" {