From 29e441f88f3e758ff6a1c8a536fdb752c5b32af9 Mon Sep 17 00:00:00 2001 From: pasquier-s Date: Thu, 22 Feb 2018 15:57:45 +0100 Subject: [PATCH] Fix miscellaneous issues revealed by Go 1.10 (#1256) * provider/mem: fix format verbs in tests * api: fix format verb --- api/api.go | 2 +- provider/mem/mem_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/api.go b/api/api.go index 38df2a91..71508f9d 100644 --- a/api/api.go +++ b/api/api.go @@ -799,7 +799,7 @@ func (api *API) respondError(w http.ResponseWriter, apiErr apiError, data interf case errorInternal: w.WriteHeader(http.StatusInternalServerError) default: - panic(fmt.Sprintf("unknown error type %q", apiErr)) + panic(fmt.Sprintf("unknown error type %q", apiErr.Error())) } b, err := json.Marshal(&response{ diff --git a/provider/mem/mem_test.go b/provider/mem/mem_test.go index e3613a9c..e0345392 100644 --- a/provider/mem/mem_test.go +++ b/provider/mem/mem_test.go @@ -134,7 +134,7 @@ func TestAlertsSubscribe(t *testing.T) { } if len(expectedAlerts) != 0 { - t.Fatalf("Unexpected number of alerts: %s", len(expectedAlerts)) + t.Fatalf("Unexpected number of alerts: %d", len(expectedAlerts)) } }() @@ -158,7 +158,7 @@ func TestAlertsSubscribe(t *testing.T) { } if len(expectedAlerts) != 0 { - t.Fatalf("Unexpected number of alerts: %s", len(expectedAlerts)) + t.Fatalf("Unexpected number of alerts: %d", len(expectedAlerts)) } }()