Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
quackduck committed Dec 19, 2022
1 parent a2ca775 commit 62d5933
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rem.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ func main() {
func getFilesToDelete() []string {
files := make([]string, len(os.Args)-1-len(ignoreArgs)) // -1 because of the first elem of os.Args
index := 0
for i, file := range os.Args[1:] {
if ignoreArgs[i+1] { // +1 as i range from 0 to len(os.Args) - 2 but the keys in ignoreArgs starts at 1
for i, file := range os.Args {
if i == 0 || ignoreArgs[i] {
continue
}
files[index] = file
Expand Down

0 comments on commit 62d5933

Please sign in to comment.