From 1e50ff924ff9495b4d4a9af34393f99126159ddf Mon Sep 17 00:00:00 2001 From: gagliardetto Date: Wed, 11 Dec 2024 21:20:41 +0100 Subject: [PATCH] Sort --- cmd-x-index-all.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd-x-index-all.go b/cmd-x-index-all.go index a16362f..1b23253 100644 --- a/cmd-x-index-all.go +++ b/cmd-x-index-all.go @@ -9,6 +9,7 @@ import ( "math/rand" "os" "path/filepath" + "sort" "time" "github.com/dustin/go-humanize" @@ -167,6 +168,10 @@ func createAllIndexes( for kind := range numItems { kinds = append(kinds, kind) } + // sort from byte value: + sort.Slice(kinds, func(i, j int) bool { + return kinds[i] < kinds[j] + }) for _, kind := range kinds { klog.Infof(" %s: %s items", iplddecoders.Kind(kind), humanize.Comma(int64(numItems[kind]))) numTotalItems += numItems[kind]