fix(updatecheck): ensure response body is closed properly
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user