Skip to content

Commit

Permalink
fixup: close body after use
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vasek <[email protected]>
  • Loading branch information
matejvasek committed Dec 12, 2023
1 parent c2d52af commit f554f97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hack/update-builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit f554f97

Please sign in to comment.