From 62e4f588185470257289b7043b545f304869c7fa Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 10 Feb 2024 15:47:33 -0800 Subject: [PATCH] fix: latest linter issues --- api-get-object_test.go | 8 ++++---- api.go | 2 +- healthcheck_test.go | 2 +- pkg/credentials/iam_aws_test.go | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api-get-object_test.go b/api-get-object_test.go index ff2415b4b..846749d2f 100644 --- a/api-get-object_test.go +++ b/api-get-object_test.go @@ -27,7 +27,7 @@ import ( ) func TestGetObjectReturnSuccess(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Last-Modified", "Wed, 21 Oct 2015 07:28:00 GMT") w.Header().Set("Content-Length", "5") @@ -61,7 +61,7 @@ func TestGetObjectReturnSuccess(t *testing.T) { } func TestGetObjectReturnErrorIfServerTruncatesResponse(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Last-Modified", "Wed, 21 Oct 2015 07:28:00 GMT") w.Header().Set("Content-Length", "100") @@ -90,7 +90,7 @@ func TestGetObjectReturnErrorIfServerTruncatesResponse(t *testing.T) { } func TestGetObjectReturnErrorIfServerTruncatesResponseDouble(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Last-Modified", "Wed, 21 Oct 2015 07:28:00 GMT") w.Header().Set("Content-Length", "1024") @@ -119,7 +119,7 @@ func TestGetObjectReturnErrorIfServerTruncatesResponseDouble(t *testing.T) { } func TestGetObjectReturnErrorIfServerSendsMore(t *testing.T) { - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Last-Modified", "Wed, 21 Oct 2015 07:28:00 GMT") w.Header().Set("Content-Length", "1") diff --git a/api.go b/api.go index 6dcee46dd..1c3cb83cd 100644 --- a/api.go +++ b/api.go @@ -234,7 +234,7 @@ func privateNew(endpoint string, opts *Options) (*Client, error) { clnt.httpClient = &http.Client{ Jar: jar, Transport: transport, - CheckRedirect: func(req *http.Request, via []*http.Request) error { + CheckRedirect: func(_ *http.Request, _ []*http.Request) error { return http.ErrUseLastResponse }, } diff --git a/healthcheck_test.go b/healthcheck_test.go index 54f3c7afc..eb681ff7e 100644 --- a/healthcheck_test.go +++ b/healthcheck_test.go @@ -27,7 +27,7 @@ import ( ) func TestHealthCheck(t *testing.T) { - srv := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + srv := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusOK) })) defer srv.Close() diff --git a/pkg/credentials/iam_aws_test.go b/pkg/credentials/iam_aws_test.go index df6df8574..4089c13ed 100644 --- a/pkg/credentials/iam_aws_test.go +++ b/pkg/credentials/iam_aws_test.go @@ -75,14 +75,14 @@ const credsRespStsImpl = `