From c33db8fe7165a13697ac54a8c732b5f84ee1ecca Mon Sep 17 00:00:00 2001 From: Kulwant Singh Date: Sat, 2 Mar 2024 01:38:32 -0800 Subject: [PATCH] Fix lint issue and err shadow --- .../internal/k8swindows/k8swindows_nowindows.go | 9 ++++----- receiver/awscontainerinsightreceiver/receiver.go | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/receiver/awscontainerinsightreceiver/internal/k8swindows/k8swindows_nowindows.go b/receiver/awscontainerinsightreceiver/internal/k8swindows/k8swindows_nowindows.go index dbc75d936351..e4e1589d229c 100644 --- a/receiver/awscontainerinsightreceiver/internal/k8swindows/k8swindows_nowindows.go +++ b/receiver/awscontainerinsightreceiver/internal/k8swindows/k8swindows_nowindows.go @@ -7,15 +7,14 @@ package k8swindows // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/k8swindows" import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/host" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/stores" - "go.opentelemetry.io/collector/pdata/pmetric" "go.uber.org/zap" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/host" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/stores" ) -type K8sWindows struct { -} +type K8sWindows struct{} // New is a dummy function to construct a dummy K8sWindows struct for linux func New(_ *zap.Logger, _ *stores.K8sDecorator, _ host.Info) (*K8sWindows, error) { diff --git a/receiver/awscontainerinsightreceiver/receiver.go b/receiver/awscontainerinsightreceiver/receiver.go index 83c368c09884..00c4550b2e4e 100644 --- a/receiver/awscontainerinsightreceiver/receiver.go +++ b/receiver/awscontainerinsightreceiver/receiver.go @@ -90,7 +90,8 @@ func (acir *awsContainerInsightReceiver) Start(ctx context.Context, host compone return err } - leaderElection, err := k8sapiserver.NewLeaderElection(acir.settings.Logger, k8sapiserver.WithLeaderLockName(acir.config.LeaderLockName), + var leaderElection *k8sapiserver.LeaderElection + leaderElection, err = k8sapiserver.NewLeaderElection(acir.settings.Logger, k8sapiserver.WithLeaderLockName(acir.config.LeaderLockName), k8sapiserver.WithLeaderLockUsingConfigMapOnly(acir.config.LeaderLockUsingConfigMapOnly)) if err != nil { return err