diff --git a/cmd/pgtidy/update.go b/cmd/pgtidy/update.go index de1b1b6..08820ee 100644 --- a/cmd/pgtidy/update.go +++ b/cmd/pgtidy/update.go @@ -131,7 +131,7 @@ func downloadAndRunInstaller(ctx context.Context, url string, out io.Writer) err if err != nil { return fmt.Errorf("downloading installer: %w", err) } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() if resp.StatusCode != http.StatusOK { return fmt.Errorf("downloading installer: unexpected status %s", resp.Status) } diff --git a/pkg/updatecheck/updatecheck.go b/pkg/updatecheck/updatecheck.go index 62665ef..b095141 100644 --- a/pkg/updatecheck/updatecheck.go +++ b/pkg/updatecheck/updatecheck.go @@ -44,7 +44,7 @@ func Latest(ctx context.Context, client *http.Client, apiURL string) (*Release, if err != nil { return nil, fmt.Errorf("checking for updates: %w", err) } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("checking for updates: unexpected status %s", resp.Status) }