Skip to content

Commit

Permalink
Merge pull request #1188 from France-ioi/do_not_close_response_body_i…
Browse files Browse the repository at this point in the history
…n_iSendrequestGeneric

Do not close the response body in iSendrequestGeneric() as it is closed inside SendTestHTTPRequest()
  • Loading branch information
zenovich authored Oct 16, 2024
2 parents 37ffb8f + bb2f56a commit 9d0f9bd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions testhelpers/steps_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ func (ctx *TestContext) iSendrequestGeneric(method, path, reqBody string) error
return err
}

// do request
//nolint:bodyclose // the body is closed in SendTestHTTPRequest
response, body, err := SendTestHTTPRequest(testServer, method, path, headers, strings.NewReader(reqBody))
defer func() { _ = response.Body.Close() }()
if err != nil {
return err
}
Expand Down

0 comments on commit 9d0f9bd

Please sign in to comment.