Skip to content

Commit

Permalink
*linter remarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuhinin committed Apr 23, 2024
1 parent c94762b commit cf2c4f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/integration/golang/helpers/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions tests/integration/golang/helpers/oidc/mock_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit cf2c4f6

Please sign in to comment.