From 92c5df6c353e9a09c87a6650fae463aa10abbd24 Mon Sep 17 00:00:00 2001 From: gy95 Date: Sat, 15 May 2021 11:00:33 +0800 Subject: [PATCH] add linter whitespace and fix linter errors Signed-off-by: gy95 --- .golangci.yml | 4 ++++ pkg/karmadactl/join.go | 1 - pkg/util/detector/detector.go | 1 - pkg/util/helper/binding.go | 1 - 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index bb02602e0..b45d6e764 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -41,9 +41,13 @@ linters: - typecheck - unused - varcheck + # other linters supported by golangci-lint. + - whitespace + linters-settings: goimports: local-prefixes: github.com/karmada-io/karmada + issues: # The list of ids of default excludes to include or disable. By default it's empty. include: diff --git a/pkg/karmadactl/join.go b/pkg/karmadactl/join.go index 1a72b80ab..9d43f1168 100644 --- a/pkg/karmadactl/join.go +++ b/pkg/karmadactl/join.go @@ -377,7 +377,6 @@ func ensureClusterRoleExist(client kubeclient.Interface, clusterRole *rbacv1.Clu } return createdObj, nil - } // ensureClusterRoleBindingExist makes sure that the specific ClusterRoleBinding exist in cluster. diff --git a/pkg/util/detector/detector.go b/pkg/util/detector/detector.go index 34ceccf66..99697a1b7 100644 --- a/pkg/util/detector/detector.go +++ b/pkg/util/detector/detector.go @@ -403,7 +403,6 @@ func (d *ResourceDetector) ApplyClusterPolicy(object *unstructured.Unstructured, } else { klog.V(2).Infof("ResourceBinding(%s) is up to date.", binding.GetName()) } - } else { binding := d.BuildClusterResourceBinding(object, objectKey, policyLabels) bindingCopy := binding.DeepCopy() diff --git a/pkg/util/helper/binding.go b/pkg/util/helper/binding.go index 4cd17dd54..d1e17f8bd 100644 --- a/pkg/util/helper/binding.go +++ b/pkg/util/helper/binding.go @@ -156,7 +156,6 @@ func FetchWorkload(dynamicClient dynamic.Interface, restMapper meta.RESTMapper, // EnsureWork ensure Work to be created or updated. func EnsureWork(c client.Client, workload *unstructured.Unstructured, clusterNames []string, overrideManager overridemanager.OverrideManager, binding metav1.Object, scope apiextensionsv1.ResourceScope) error { - referenceRSP, desireReplicaInfos, err := calculateReplicasIfNeeded(c, workload, clusterNames) if err != nil { klog.Errorf("Failed to get ReplicaSchedulingPolicy for %s/%s/%s, err is: %v", workload.GetKind(), workload.GetNamespace(), workload.GetName(), err)