Skip to content

Commit a9110d3

Browse files
committed
Sort envs by name
1 parent 0ad5104 commit a9110d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

formatters/environments.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package formatters
22

33
import (
44
"fmt"
5+
"sort"
56
)
67

78
type Environment struct {
@@ -52,6 +53,9 @@ func FormatEnv(env Environment) string {
5253
}
5354
func FormatEnvs(envRes EnvResponse, grouped bool) string {
5455
output := make(map[string]string)
56+
sort.Slice(envRes.Values, func(i, j int) bool {
57+
return envRes.Values[i].Name < envRes.Values[j].Name
58+
})
5559
for i := 0; i < len(envRes.Values); i++ {
5660
env := envRes.Values[i]
5761

0 commit comments

Comments
 (0)