INNER CODE UNIT · Go
printCacheInfo
kitops-ml/kitops · pkg/cmd/kitcache/cmd.go:93
func printCacheInfo(w io.Writer, totalSize int64, subpaths map[string]int64) {
var subpathNames []string
for s := range subpaths {
subpathNames = append(subpathNames, s)
}
sort.Strings(subpathNames)
fmt.Fprintf(w, "Total size of cache directory: %s\n", output.FormatBytes(totalSize))
fmt.Fprintln(w, "Cache contents:")
tw := tabwriter.NewWriter(w, 0, 2, 4, ' ', 0)
for _, subpath := range subpathNames {
fmt.Fprintf(tw, " ./%s\t%s\n", subpath, output.FormatBytes(subpaths[subpath]))
}
tw.Flush()
}