Skip to content

Commit

Permalink
Sort default output by namespace id. Avoids having different output e…
Browse files Browse the repository at this point in the history
…verytime.

Signed-off-by: Matthias Schmidt <matthias.schmidt@gmail.com>
  • Loading branch information
ms140569 committed May 10, 2020
1 parent 381953e commit ebb342d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion namespaces/namespaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,19 @@ func Showall() {
ntable.SetHeaderAlignment(tw.ALIGN_LEFT)
ntable.SetAutoWrapText(false)
debug("\n\n=== SUMMARY")
for n, pl := range namespaces {

keys := make([]Namespace, 0, len(namespaces))
for k := range namespaces {
keys = append(keys, k)
}

sort.Slice(keys, func(i, j int) bool {
return keys[i].Id < keys[j].Id
})

for _, n := range keys {
pl := namespaces[n]

debug(fmt.Sprintf("namespace %s: %v\n", n.Id, pl))
u := ""
suids := make([]int, 0)
Expand Down

0 comments on commit ebb342d

Please sign in to comment.