From cf2c4f6fa3b055cad56dc5a397ab3b7cb5a0aac9 Mon Sep 17 00:00:00 2001 From: Software Developer <7852635+dsuhinin@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:35:43 +0200 Subject: [PATCH] *linter remarks. --- tests/integration/golang/helpers/client.go | 4 ++++ tests/integration/golang/helpers/oidc/mock_server.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tests/integration/golang/helpers/client.go b/tests/integration/golang/helpers/client.go index af977885b..c4b0fd9d7 100644 --- a/tests/integration/golang/helpers/client.go +++ b/tests/integration/golang/helpers/client.go @@ -182,17 +182,21 @@ func (c *HttpClient) DoRequest(uri string, values ...any) error { } // 7. send request data and handle possible redirects. + //nolint:bodyclose resp, err := c.server.Test(req, 60000) if err != nil { return eris.Wrap(err, "error doing request") } if resp.StatusCode == http.StatusMovedPermanently { req.RequestURI = resp.Header.Get("location") + //nolint:bodyclose resp, err = c.server.Test(req, 60000) if err != nil { return eris.Wrap(err, "error doing request") } } + //nolint:errcheck + defer resp.Body.Close() c.statusCode = resp.StatusCode diff --git a/tests/integration/golang/helpers/oidc/mock_server.go b/tests/integration/golang/helpers/oidc/mock_server.go index f2cb3dbc1..9ff61ef64 100644 --- a/tests/integration/golang/helpers/oidc/mock_server.go +++ b/tests/integration/golang/helpers/oidc/mock_server.go @@ -70,6 +70,7 @@ func (m MockServer) Login(ctx context.Context, user *mockoidc.MockUser, scopes [ return http.ErrUseLastResponse }, } + //nolint:bodyclose authorizeResponse, err := httpClient.Do(authorizeRequest) if err != nil { return "", eris.Wrap(err, "error making authorization request") @@ -119,6 +120,7 @@ func (m MockServer) Login(ctx context.Context, user *mockoidc.MockUser, scopes [ ) } + //nolint defer tokenResponse.Body.Close() body, err := io.ReadAll(tokenResponse.Body) if err != nil {