1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-23 23:15:07 +00:00

fix(analyze): count top-level files in json output

This commit is contained in:
tw93
2026-03-07 10:10:41 +08:00
parent 09d0de0c8e
commit 89a9ae0ce2
2 changed files with 28 additions and 1 deletions

View File

@@ -58,6 +58,8 @@ func performScanForJSON(path string) jsonOutput {
info, err := item.Info()
if err == nil {
size = info.Size()
atomic.AddInt64(&filesScanned, 1)
atomic.AddInt64(&bytesScanned, size)
}
}
@@ -74,6 +76,6 @@ func performScanForJSON(path string) jsonOutput {
Path: path,
Entries: entries,
TotalSize: totalSize,
TotalFiles: filesScanned,
TotalFiles: atomic.LoadInt64(&filesScanned),
}
}