From d5efbdab43f4c1bbddfcadb4e7d6bf53a1b875ca Mon Sep 17 00:00:00 2001 From: justinsb Date: Mon, 21 Oct 2024 09:40:43 -0400 Subject: [PATCH] chore: cleanup a few lint problems Some small non-functional changes to avoid the IDE giving us false-positive problem warnings. --- pkg/controller/direct/common/labels.go | 2 +- pkg/controller/direct/monitoring/client.go | 2 +- .../direct/monitoring/monitoringdashboard_controller.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/controller/direct/common/labels.go b/pkg/controller/direct/common/labels.go index f33f9067db..dee7ca637c 100644 --- a/pkg/controller/direct/common/labels.go +++ b/pkg/controller/direct/common/labels.go @@ -23,7 +23,7 @@ func ComputeGCPLabels(labels map[string]string) map[string]string { } func RemoveByPrefixes(a map[string]string, prefixes ...string) { - for k, _ := range a { + for k := range a { for i := range prefixes { if strings.HasPrefix(k, prefixes[i]) { delete(a, k) diff --git a/pkg/controller/direct/monitoring/client.go b/pkg/controller/direct/monitoring/client.go index f4990d6783..8b0c8a28ff 100644 --- a/pkg/controller/direct/monitoring/client.go +++ b/pkg/controller/direct/monitoring/client.go @@ -26,7 +26,7 @@ type gcpClient struct { config config.ControllerConfig } -func newGCPClient(ctx context.Context, config *config.ControllerConfig) (*gcpClient, error) { +func newGCPClient(config *config.ControllerConfig) (*gcpClient, error) { gcpClient := &gcpClient{ config: *config, } diff --git a/pkg/controller/direct/monitoring/monitoringdashboard_controller.go b/pkg/controller/direct/monitoring/monitoringdashboard_controller.go index ceea5e03b1..3bae31b739 100644 --- a/pkg/controller/direct/monitoring/monitoringdashboard_controller.go +++ b/pkg/controller/direct/monitoring/monitoringdashboard_controller.go @@ -64,7 +64,7 @@ var _ directbase.Adapter = &dashboardAdapter{} // AdapterForObject implements the Model interface. func (m *dashboardModel) AdapterForObject(ctx context.Context, kube client.Reader, u *unstructured.Unstructured) (directbase.Adapter, error) { - gcpClient, err := newGCPClient(ctx, m.config) + gcpClient, err := newGCPClient(m.config) if err != nil { return nil, fmt.Errorf("building gcp client: %w", err) } @@ -122,7 +122,7 @@ func (m *dashboardModel) AdapterForURL(ctx context.Context, url string) (directb tokens := strings.Split(strings.TrimPrefix(url, "//monitoring.googleapis.com/"), "/") if len(tokens) == 4 && tokens[0] == "projects" && tokens[2] == "dashboards" { - gcpClient, err := newGCPClient(ctx, m.config) + gcpClient, err := newGCPClient(m.config) if err != nil { return nil, fmt.Errorf("building gcp client: %w", err) }