From 02012da4624339c237e0d0f1da40766b6aa92679 Mon Sep 17 00:00:00 2001 From: Kristof Gyuracz Date: Wed, 6 Mar 2024 15:00:52 +0100 Subject: [PATCH] lint fix Signed-off-by: Kristof Gyuracz --- .../telemetry/collector_controller.go | 20 ------------------- .../telemetry/controller_integration_test.go | 3 ++- .../telemetry/otel_conf_gen_test.go | 2 +- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/internal/controller/telemetry/collector_controller.go b/internal/controller/telemetry/collector_controller.go index d3904b16..acc533a1 100644 --- a/internal/controller/telemetry/collector_controller.go +++ b/internal/controller/telemetry/collector_controller.go @@ -19,7 +19,6 @@ import ( "fmt" "reflect" "slices" - "strings" "time" "emperror.dev/errors" @@ -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 -} diff --git a/internal/controller/telemetry/controller_integration_test.go b/internal/controller/telemetry/controller_integration_test.go index d8a2e75a..8c60f5d8 100644 --- a/internal/controller/telemetry/controller_integration_test.go +++ b/internal/controller/telemetry/controller_integration_test.go @@ -4,13 +4,14 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + package telemetry import ( diff --git a/internal/controller/telemetry/otel_conf_gen_test.go b/internal/controller/telemetry/otel_conf_gen_test.go index f03bc87f..d02fc7c2 100644 --- a/internal/controller/telemetry/otel_conf_gen_test.go +++ b/internal/controller/telemetry/otel_conf_gen_test.go @@ -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