mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 10:26:35 +00:00
Chore: Use standard lib
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user