Skip to content

Commit

Permalink
Fix Gosec issue
Browse files Browse the repository at this point in the history
  • Loading branch information
satyakonduri committed Feb 20, 2023
1 parent 6d5c0b5 commit 1e899f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/utils/k8s_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ func DownloadBinary(version string) error {
return err
}

defer resp.Body.Close()
defer func() {
if err := resp.Body.Close(); err != nil {
log.Errorf("Error closing HTTP response: %s", err.Error())
}
}()

// Create the file
out, err := os.Create(BinaryFile)
Expand Down

0 comments on commit 1e899f9

Please sign in to comment.