mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Chore: Use standard lib
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"sort"
|
||||
"strings"
|
||||
"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
|
||||
func SortSecretsByKeys(secrets []models.SingleEnvironmentVariable) []models.SingleEnvironmentVariable {
|
||||
for i := 0; i < len(secrets); i++ {
|
||||
for j := i + 1; j < len(secrets); j++ {
|
||||
if secrets[i].Key > secrets[j].Key {
|
||||
secrets[i], secrets[j] = secrets[j], secrets[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sort.Slice(secrets, func(i, j int) bool {
|
||||
return secrets[i].Key < secrets[j].Key
|
||||
})
|
||||
return secrets
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user