chore: always sort returned formations

This commit is contained in:
Jose Diaz-Gonzalez committed 2024-02-11 21:12:25 -05:00
1 parent 0102d219f3
commit 31abd7e31e
2 files changed
+1 -3

No files matched your search

+1 -1
View File
@@ -212,6 +212,7 @@ func getFormations(appName string) (FormationSlice, error) {
formations = append(formations, formation) formations = append(formations, formation)
} }
sort.Sort(formations)
return formations, nil return formations, nil
} }
@@ -236,7 +237,6 @@ func scaleReport(appName string) error {
content = append(content, "proctype=qty", "--------=---") content = append(content, "proctype=qty", "--------=---")
} }
sort.Sort(formations)
for _, formation := range formations { for _, formation := range formations {
content = append(content, fmt.Sprintf("%s=%d", formation.ProcessType, formation.Quantity)) content = append(content, fmt.Sprintf("%s=%d", formation.ProcessType, formation.Quantity))
} }
-2
View File
@@ -6,7 +6,6 @@ import (
"os" "os"
"path" "path"
"path/filepath" "path/filepath"
"sort"
"strconv" "strconv"
"strings" "strings"
@@ -298,7 +297,6 @@ func TriggerPsCurrentScale(appName string) error {
return err return err
} }
sort.Sort(formations)
lines := []string{} lines := []string{}
for _, formation := range formations { for _, formation := range formations {
lines = append(lines, fmt.Sprintf("%s=%d", formation.ProcessType, formation.Quantity)) lines = append(lines, fmt.Sprintf("%s=%d", formation.ProcessType, formation.Quantity))