From daa9993dede216c2276e46513de9f45abd7a3c73 Mon Sep 17 00:00:00 2001 From: Karsten Weiss Date: Fri, 13 Apr 2018 22:11:50 +0200 Subject: [PATCH] Use direct API calls Fixes: prometheus/http_test.go:117:5:warning: should use resp.Body.String() instead of string(resp.Body.Bytes()) (S1030) (megacheck) prometheus/http_test.go:118:56:warning: should use resp.Body.String() instead of string(resp.Body.Bytes()) (S1030) (megacheck) Signed-off-by: Karsten Weiss --- prometheus/http_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prometheus/http_test.go b/prometheus/http_test.go index 0c7fa23..5c0ae30 100644 --- a/prometheus/http_test.go +++ b/prometheus/http_test.go @@ -114,8 +114,8 @@ func TestInstrumentHandler(t *testing.T) { if resp.Code != http.StatusTeapot { t.Fatalf("expected status %d, got %d", http.StatusTeapot, resp.Code) } - if string(resp.Body.Bytes()) != "Howdy there!" { - t.Fatalf("expected body %s, got %s", "Howdy there!", string(resp.Body.Bytes())) + if resp.Body.String() != "Howdy there!" { + t.Fatalf("expected body %s, got %s", "Howdy there!", resp.Body.String()) } out := &dto.Metric{}