@@ -178,7 +178,9 @@ func WriteFileLogs(destinationFolder string, sortedFiles, duplicateFiles []File)
178
178
sortedFilesWithDuplicates := []File {}
179
179
for _ , file := range sortedFiles {
180
180
file .Duplicates = GetDuplicates (duplicateFiles , file .Hash )
181
- sortedFilesWithDuplicates = append (sortedFilesWithDuplicates , file )
181
+ if len (file .Duplicates ) > 0 {
182
+ sortedFilesWithDuplicates = append (sortedFilesWithDuplicates , file )
183
+ }
182
184
}
183
185
184
186
// Create destination path
@@ -193,13 +195,11 @@ func WriteFileLogs(destinationFolder string, sortedFiles, duplicateFiles []File)
193
195
htmlString := "<!DOCTYPE html><html lang='en'><head><meta charset='UTF-8'/><title>Duplicates</title></head><body><h1>Duplicates</h1><ul>"
194
196
195
197
for _ , file := range sortedFilesWithDuplicates {
196
- if len (file .Duplicates ) > 0 {
197
- htmlString = htmlString + "<li><p><a href='file://" + file .Path + "' target='_blank'>" + file .RelativePath + " (" + file .Hash + ")</a></p><ul>"
198
- for _ , duplicate := range file .Duplicates {
199
- htmlString = htmlString + "<li><p><a href='file://" + duplicate .Path + "' target='_blank'>" + duplicate .RelativePath + "</a></p></li>"
200
- }
201
- htmlString = htmlString + "</ul></li>"
198
+ htmlString = htmlString + "<li><p><a href='file://" + file .Path + "' target='_blank'>" + file .RelativePath + " (" + file .Hash + ")</a></p><ul>"
199
+ for _ , duplicate := range file .Duplicates {
200
+ htmlString = htmlString + "<li><p><a href='file://" + duplicate .Path + "' target='_blank'>" + duplicate .RelativePath + "</a></p></li>"
202
201
}
202
+ htmlString = htmlString + "</ul></li>"
203
203
}
204
204
205
205
htmlString = htmlString + "</ul></body></html>"
0 commit comments