Skip to content

Commit

Permalink
Merge pull request #4151 from testwill/close_file
Browse files Browse the repository at this point in the history
fix: close resources
  • Loading branch information
kptdev-robot[bot] authored Jun 7, 2024
2 parents 4befc8c + 1548ea8 commit 43d4444
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/util/pkgutil/pkgutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ func RemovePackageContent(path string, removeRootKptfile bool) error {
if err != nil {
return err
}
defer f.Close()
// List up to one file or folder in the directory.
_, err = f.Readdirnames(1)
if err != nil && err != io.EOF {
Expand Down

0 comments on commit 43d4444

Please sign in to comment.