chore: use slices.Sorted(maps.Keys()) for ordered iteration

This commit is contained in:
Claude 2026-02-24 15:45:03 +00:00
parent f4848deda6
commit 31985fa801
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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])
}
}