Debug index output is now sorted

This commit is contained in:
Seednode 2023-04-28 13:26:47 -05:00
parent 9cd9c286c2
commit 84af467feb
2 changed files with 8 additions and 2 deletions

View File

@ -10,7 +10,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var Version = "0.41.0" var Version = "0.41.1"
func init() { func init() {
rootCmd.AddCommand(versionCmd) rootCmd.AddCommand(versionCmd)

View File

@ -653,7 +653,13 @@ func serveIndexHandler(args []string, index *Index) http.HandlerFunc {
startTime := time.Now() startTime := time.Now()
response, err := json.MarshalIndent(index.Index(), "", " ") indexDump := index.Index()
sort.SliceStable(indexDump, func(p, q int) bool {
return indexDump[p] < indexDump[q]
})
response, err := json.MarshalIndent(indexDump, "", " ")
if err != nil { if err != nil {
return return
} }