Use direct API calls

Fixes:
prometheus/http_test.go:117:5⚠️ should use resp.Body.String() instead of string(resp.Body.Bytes()) (S1030) (megacheck)
prometheus/http_test.go:118:56⚠️ should use resp.Body.String() instead of string(resp.Body.Bytes()) (S1030) (megacheck)

Signed-off-by: Karsten Weiss <knweiss@gmail.com>
This commit is contained in:
Karsten Weiss 2018-04-13 22:11:50 +02:00
parent e11c6ff817
commit daa9993ded
1 changed files with 2 additions and 2 deletions

View File

@ -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{}