chore: use slices.Sorted(maps.Keys()) for ordered iteration
This commit is contained in:
parent
f4848deda6
commit
31985fa801
1 changed files with 2 additions and 6 deletions
|
|
@ -4,6 +4,7 @@ package setup
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"maps"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
|
|
@ -184,12 +185,7 @@ func (cs *ChangeSet) printByCategory(category ChangeCategory, title string) {
|
|||
fmt.Println()
|
||||
|
||||
// Print details (sorted for deterministic output)
|
||||
keys := make([]string, 0, len(c.Details))
|
||||
for k := range c.Details {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
slices.Sort(keys)
|
||||
for _, k := range keys {
|
||||
for _, k := range slices.Sorted(maps.Keys(c.Details)) {
|
||||
fmt.Printf(" %s: %s\n", dimStyle.Render(k), c.Details[k])
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue