From c3eb92271b78c5183924b39d60f44981a042bcde Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 15 Feb 2024 15:58:30 +0200 Subject: [PATCH] linter --- .golangci.yml | 1 + pkg/install/install.go | 2 +- pkg/kubernetes/client/client.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index b5fa706d..0c2df182 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -48,6 +48,7 @@ linters: - wsl # too many empty lines makes methods too long - wrapcheck # forces to wrap errors everywhere - lll # Just useless in the most cases + - perfsprint # to keep errors consistent issues: diff --git a/pkg/install/install.go b/pkg/install/install.go index d043a912..c2a48b25 100644 --- a/pkg/install/install.go +++ b/pkg/install/install.go @@ -615,7 +615,7 @@ func ValidateNamespaces(str string) ([]string, error) { m[ns] = struct{}{} } - var list []string + list := make([]string, 0, len(m)) for k := range m { list = append(list, k) } diff --git a/pkg/kubernetes/client/client.go b/pkg/kubernetes/client/client.go index e140d659..7017a94e 100644 --- a/pkg/kubernetes/client/client.go +++ b/pkg/kubernetes/client/client.go @@ -104,7 +104,7 @@ type Client struct { customClientSet *customresources.Client apiextClientset apiextv1clientset.Interface dynamicClientset dynamic.Interface - dbClusterClient *database.DBClusterClient + dbClusterClient *database.DBClusterClient //nolint:structcheck rcLock *sync.Mutex restConfig *rest.Config namespace string