Skip to content

Commit

Permalink
Fixed loop var
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-kuendig committed Aug 24, 2023
1 parent 3441cae commit a376fc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func newDeleteAction(dir *directory, fs Filesystem, log logger, pretend bool) *d
// perform deletes files that are past a certain age or certain size.
func (a deleteAction) perform(files []os.FileInfo, check checkFn) ([]os.FileInfo, error) {
for i, file := range files {
file := file
filename := a.fs.FullPath(file, a.dir.Path)
if check(file) {
if a.pretend {
Expand Down
3 changes: 2 additions & 1 deletion zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func newZipAction(dir *directory, fs Filesystem, log logger, pretend bool) *zipA
// perform zips files that are past a certain age or certain size.
func (a zipAction) perform(files []os.FileInfo, check checkFn) ([]os.FileInfo, error) {
for i, file := range files {
file := file
filename := a.fs.FullPath(file, a.dir.Path)

if check(file) {
Expand All @@ -37,7 +38,7 @@ func (a zipAction) perform(files []os.FileInfo, check checkFn) ([]os.FileInfo, e
err = a.fs.Remove(filename)
if err != nil {
a.log.Printf("[ZIP] ERROR: Failed to delete original file %s: %s", filename, err)
continue;
continue
}
files = a.action.removeFile(files, i)
} else {
Expand Down

0 comments on commit a376fc6

Please sign in to comment.