fix(updatecheck): ensure response body is closed properly
CI / Test (push) Successful in 1m24s
CI / Build (push) Successful in 1m9s

This commit is contained in:
Hein
2026-10-06 17:01:15 +02:00
parent 0b26c49931
commit c540517eca
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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)
}
+1 -1
View File
@@ -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)
}