Skip to content

Commit aface05

Browse files
committed
refactor: change when we close the response body so the linter is happy
1 parent ce407a1 commit aface05

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/apitester/main_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ func jsonReplaceRules(t *testing.T, resp *http.Response) []jsonreplace.Rule {
4949
func normalizeJSONBody(t *testing.T, resp *http.Response) string {
5050
t.Helper()
5151

52-
defer resp.Body.Close()
53-
5452
body, err := io.ReadAll(resp.Body)
5553

5654
if err != nil {
@@ -77,6 +75,8 @@ func Test(t *testing.T) {
7775
resp := vcr.Play(t, interaction)
7876
body := normalizeJSONBody(t, resp)
7977

78+
resp.Body.Close()
79+
8080
snaps.
8181
WithConfig(snaps.Filename(vcr.DetermineCassetteName(cas))).
8282
MatchSnapshot(t, body)

0 commit comments

Comments
 (0)