From 84af467feba6b2aa8156e214e2bd292b43992e53 Mon Sep 17 00:00:00 2001 From: Seednode Date: Fri, 28 Apr 2023 13:26:47 -0500 Subject: [PATCH] Debug index output is now sorted --- cmd/version.go | 2 +- cmd/web.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/version.go b/cmd/version.go index 6829397..f37429d 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" ) -var Version = "0.41.0" +var Version = "0.41.1" func init() { rootCmd.AddCommand(versionCmd) diff --git a/cmd/web.go b/cmd/web.go index 4e10e9f..e8431cb 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -653,7 +653,13 @@ func serveIndexHandler(args []string, index *Index) http.HandlerFunc { 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 { return }