- Go package for collecting project statistic (lines of code, methods, files, components, etc.)
- Core package for @statloc
- Used both by server and CLI
go get github.com/statloc/core
package main
import (
"github.com/statloc/core"
"fmt"
)
func main() {
stats := core.GetStatistics("/path/to/project")
total := stats.Items["Total"]
result := = fmt.Sprintf(
`Statistics(total):
lines of code: %d
files: %d`,
total.LOC,
total.Files,
)
fmt.Println(results)
}
Follow our guide to contribute to this project