fix category count
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Arnas Udovic 2025-03-16 14:24:27 +02:00
parent eb56e5c923
commit e655ccfd40

View file

@ -1,8 +1,9 @@
package main package main
import ( import (
zordTree "g.arns.lt/zordsdavini/zord-tree"
"strings" "strings"
zordTree "g.arns.lt/zordsdavini/zord-tree"
) )
func FormatTreeSummery(tree zordTree.Tree) Tree { func FormatTreeSummery(tree zordTree.Tree) Tree {
@ -24,11 +25,7 @@ func readTree(tree zordTree.Tree, ts *Tree, isRoot bool) {
if ts.Categories == nil { if ts.Categories == nil {
ts.Categories = make(map[string]int32) ts.Categories = make(map[string]int32)
} }
if _, ok := ts.Categories[category]; ok { ts.Categories[category] = int32(len(subtree.Files))
ts.Categories[category]++
} else {
ts.Categories[category] = 1
}
} }
} }