From 7a2d222b0ff80607b5f16d4baa1c028f940b44dc Mon Sep 17 00:00:00 2001 From: Michael Nikitochkin Date: Mon, 12 Sep 2022 21:14:06 +0200 Subject: [PATCH] Fix linting problems --- api_test.go | 5 ----- client/client.go | 6 +++++- client/client_test.go | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api_test.go b/api_test.go index e25838b0..734a6c44 100644 --- a/api_test.go +++ b/api_test.go @@ -28,11 +28,6 @@ func WithServer(t *testing.T, f func(string)) { // Make sure only one server is running at a time. Apparently there's no clean // way to shut it down between each test run. - logger := zerolog.Nop() - if _, ok := os.LookupEnv("DEBUG"); ok { - logger = zerolog.New(os.Stdout).With().Caller().Timestamp().Logger() - } - if testServer == nil { testServer = toxiproxy.NewServer( toxiproxy.NewMetricsContainer(prometheus.NewRegistry()), diff --git a/client/client.go b/client/client.go index d590367b..83c2fd7b 100644 --- a/client/client.go +++ b/client/client.go @@ -331,7 +331,11 @@ func (c *Client) validateResponse(resp *http.Response, expectedCode int) error { err = json.Unmarshal(result, apiError) if err != nil { - apiError.Message = fmt.Sprintf("Unexpected response code %d, expected %d", resp.StatusCode, expectedCode) + apiError.Message = fmt.Sprintf( + "Unexpected response code %d, expected %d", + resp.StatusCode, + expectedCode, + ) apiError.Status = resp.StatusCode } return apiError diff --git a/client/client_test.go b/client/client_test.go index 1794ca63..92063b17 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -18,7 +18,8 @@ import ( // t.Run(tc.name, func(t *testing.T) { // t.Parallel() // -// server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { +// server := httptest.NewServer( +// http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // w.WriteHeader(http.StatusOK) // })) // defer server.Close()