From 4acc48270482cb004bccbbe832a9fe17cfb0d120 Mon Sep 17 00:00:00 2001 From: Karol Nowak Date: Wed, 18 Sep 2024 11:58:06 +0200 Subject: [PATCH] chore: fix lint --- frontend_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend_test.go b/frontend_test.go index eaaa6f4..e73fea8 100644 --- a/frontend_test.go +++ b/frontend_test.go @@ -164,7 +164,6 @@ func TestFrontend_Get(t *testing.T) { } } -//nolint:bodyclose // response might be nil so we cannot close the body func TestContextDeadlineExceeded(t *testing.T) { t.Parallel() @@ -223,7 +222,11 @@ func loaderWithWaitingTime(ctx context.Context) (httpcache.Entry, error) { } client := &http.Client{} - _, err = client.Do(req) + resp, err := client.Do(req) + + if resp != nil { + _ = resp.Body.Close() + } if err != nil { return httpcache.Entry{}, err