Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
Signed-off-by: Kristof Gyuracz <kristof.gyuracz@axoflow.com>
  • Loading branch information
kristofgyuracz committed Mar 6, 2024
1 parent bc8ea1a commit d93ac68
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
20 changes: 0 additions & 20 deletions internal/controller/telemetry/collector_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"fmt"
"reflect"
"slices"
"strings"
"time"

"emperror.dev/errors"
Expand Down Expand Up @@ -440,22 +439,3 @@ func normalizeStringSlice(inputList []string) []string {

return uniqueList
}

func normalizeNamespacedNameSlice(inputList []v1alpha1.NamespacedName) []v1alpha1.NamespacedName {
allKeys := make(map[v1alpha1.NamespacedName]bool)
uniqueList := []v1alpha1.NamespacedName{}
for _, item := range inputList {
if _, value := allKeys[item]; !value {
allKeys[item] = true
uniqueList = append(uniqueList, item)
}
}

cmp := func(a, b v1alpha1.NamespacedName) int {
return strings.Compare(a.String(), b.String())
}

slices.SortFunc(uniqueList, cmp)

return uniqueList
}
2 changes: 1 addition & 1 deletion internal/controller/telemetry/otel_conf_gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestOtelColConfComplex(t *testing.T) {
tenant := inputCfg.Tenants[0]

keysOfMap := func(subsMap map[v1alpha1.NamespacedName]v1alpha1.Subscription) (names []v1alpha1.NamespacedName) {
for key, _ := range subsMap {
for key := range subsMap {
names = append(names, key)
}
return
Expand Down

0 comments on commit d93ac68

Please sign in to comment.