by dchest on 12/9/2018, 10:43:53 PM
by creatornator on 12/9/2018, 10:33:42 PM
I made a similar utility a while back to help trim down my family photos library that had many duplicates [0]. I took the approach of a dry-run option and an option to go ahead and delete duplicate files too. It also traverses the folder recursively, to get all files in a tree.
by omerh on 12/10/2018, 1:45:22 PM
Did a complete refactor to do it more efficiently
Don't use defer f.Close() in the loop — defer will execute after the function returns. What you're doing is opening all of the files in the directory and then closing them only when the program exists.
Already boolean, this should be Apart from all of this, it looks like the algorithm is very inefficient with all of those slice manipulations.