chore: code cleanup

More usage of slices package, less usage of package sort.

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
This commit is contained in:
Dmitriy Matrenichev
2024-11-07 20:30:32 +03:00
parent 43fe3807a8
commit e26d0043e0
62 changed files with 189 additions and 204 deletions

View File

@@ -6,11 +6,12 @@
package encryption
import (
"cmp"
"context"
"encoding/json"
"errors"
"fmt"
"sort"
"slices"
"strconv"
"time"
@@ -66,7 +67,7 @@ func NewHandler(encryptionConfig block.EncryptionSpec, volumeID string, getSyste
}
//nolint:scopelint
sort.Slice(keyHandlers, func(i, j int) bool { return keyHandlers[i].Slot() < keyHandlers[j].Slot() })
slices.SortFunc(keyHandlers, func(a, b keys.Handler) int { return cmp.Compare(a.Slot(), b.Slot()) })
provider := luks.New(
cipher,