From 3a7c88c9f8af5ab2adf23ba198b0081a615ad14e Mon Sep 17 00:00:00 2001 From: Etai Lev Ran Date: Fri, 5 Jan 2024 16:17:00 +0200 Subject: [PATCH] enable whitespace linter Signed-off-by: Etai Lev Ran --- .golangci.yaml | 1 + cmd/gwctl/subcommand/gwctl.go | 1 - pkg/k8s/kubernetes/kubeinformer.go | 1 - pkg/platform/k8s/pod_reconciler_test.go | 1 - pkg/utils/netutils/netutils.go | 1 - 5 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index c8f5f567..9fa6c85a 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -71,6 +71,7 @@ linters: - unused - usestdlibvars # - varnamelen + - whitespace linters-settings: gocritic: diff --git a/cmd/gwctl/subcommand/gwctl.go b/cmd/gwctl/subcommand/gwctl.go index 6a83beab..7769f91d 100644 --- a/cmd/gwctl/subcommand/gwctl.go +++ b/cmd/gwctl/subcommand/gwctl.go @@ -46,7 +46,6 @@ func InitCmd() *cobra.Command { Short: "A start command set all parameter state of gwctl (gw control)", Long: `A start command set all parameter state of gwctl (gw control)`, RunE: func(cmd *cobra.Command, args []string) error { - return o.run() }, } diff --git a/pkg/k8s/kubernetes/kubeinformer.go b/pkg/k8s/kubernetes/kubeinformer.go index 565f474c..ba5fd9e3 100644 --- a/pkg/k8s/kubernetes/kubeinformer.go +++ b/pkg/k8s/kubernetes/kubeinformer.go @@ -448,7 +448,6 @@ func (k *kubeData) CreateEndpoint(epName, namespace, targetIP string, targetPort if err != nil { log.Errorf("Error creating endpoint: %s", err) return err - } k.serviceMap[epName] = namespace diff --git a/pkg/platform/k8s/pod_reconciler_test.go b/pkg/platform/k8s/pod_reconciler_test.go index 7db7e910..75309b5f 100644 --- a/pkg/platform/k8s/pod_reconciler_test.go +++ b/pkg/platform/k8s/pod_reconciler_test.go @@ -81,7 +81,6 @@ func TestPodReconciler(t *testing.T) { require.NoError(t, err) require.Empty(t, podReconciler.ipToPod, "ipToPod map should be empty") require.Empty(t, podReconciler.podList, "podList map should be empty") - } func getFakeClient(initObjs ...client.Object) (client.WithWatch, error) { diff --git a/pkg/utils/netutils/netutils.go b/pkg/utils/netutils/netutils.go index 49d481a6..12b40ea9 100755 --- a/pkg/utils/netutils/netutils.go +++ b/pkg/utils/netutils/netutils.go @@ -107,7 +107,6 @@ func CreateDefaultResilientHTTPServer(addr string, mux http.Handler) *http.Serve // CreateResilientHTTPServer returns an http.Server configured with the timeouts provided. func CreateResilientHTTPServer(addr string, mux http.Handler, tlsConfig *tls.Config, headerReadTimeout, writeTimeout, idleTimeout *time.Duration) *http.Server { - const ( defaultReadHeaderTimeout = 2 * time.Second defaultWriteTimeout = 2 * time.Second