From f554f971278fc74a6734708bdd813b2be3d9d65f Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Tue, 12 Dec 2023 22:42:45 +0100 Subject: [PATCH] fixup: close body after use Signed-off-by: Matej Vasek --- hack/update-builder.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hack/update-builder.go b/hack/update-builder.go index e9e2a43509..5104c69bfd 100644 --- a/hack/update-builder.go +++ b/hack/update-builder.go @@ -570,10 +570,14 @@ func addQuarkusBuildpack(packageDesc *buildpackage.Config, bpDesc *dist.Buildpac } func downloadTarball(tarballUrl, destDir string) error { + //nolint:bodyclose resp, err := http.Get(tarballUrl) if err != nil { return fmt.Errorf("cannot get tarball: %w", err) } + defer func(Body io.ReadCloser) { + _ = Body.Close() + }(resp.Body) if resp.StatusCode != 200 { return fmt.Errorf("cannot get tarball: %s", resp.Status) }