sort json output for info command

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman 2025-11-18 14:21:28 -05:00
parent 624668ada7
commit 5b96035d0a

View File

@ -155,6 +155,14 @@ func renderCatalogerInfoJSON(doc *capabilities.Document, catalogers []capabiliti
docOut := document{}
// sort catalogers by ecosystem then name
sort.Slice(catalogers, func(i, j int) bool {
if catalogers[i].Ecosystem != catalogers[j].Ecosystem {
return catalogers[i].Ecosystem < catalogers[j].Ecosystem
}
return catalogers[i].Name < catalogers[j].Name
})
for _, cat := range catalogers {
info := catalogerInfo{
Ecosystem: cat.Ecosystem,