Chore: Use standard lib

This commit is contained in:
Daniel Hougaard
2024-04-22 19:50:24 +02:00
parent 973ed37018
commit 519d6f98a2
+4 -8
View File
@@ -8,6 +8,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"path" "path"
"sort"
"strings" "strings"
"time" "time"
@@ -55,14 +56,9 @@ func GetBase64DecodedSymmetricEncryptionDetails(key string, cipher string, IV st
// Helper function to sort the secrets by key so we can create a consistent output // Helper function to sort the secrets by key so we can create a consistent output
func SortSecretsByKeys(secrets []models.SingleEnvironmentVariable) []models.SingleEnvironmentVariable { func SortSecretsByKeys(secrets []models.SingleEnvironmentVariable) []models.SingleEnvironmentVariable {
for i := 0; i < len(secrets); i++ { sort.Slice(secrets, func(i, j int) bool {
for j := i + 1; j < len(secrets); j++ { return secrets[i].Key < secrets[j].Key
if secrets[i].Key > secrets[j].Key { })
secrets[i], secrets[j] = secrets[j], secrets[i]
}
}
}
return secrets return secrets
} }