diff --git a/pkg/controller/volume/attachdetach/attach_detach_controller.go b/pkg/controller/volume/attachdetach/attach_detach_controller.go index 1d628afbfc5..967f40f172b 100644 --- a/pkg/controller/volume/attachdetach/attach_detach_controller.go +++ b/pkg/controller/volume/attachdetach/attach_detach_controller.go @@ -90,7 +90,7 @@ type TimerConfig struct { // DefaultTimerConfig is the default configuration of Attach/Detach controller // timers. -var DefaultTimerConfig TimerConfig = TimerConfig{ +var DefaultTimerConfig = TimerConfig{ ReconcilerLoopPeriod: 100 * time.Millisecond, ReconcilerMaxWaitForUnmountDuration: 6 * time.Minute, DesiredStateOfWorldPopulatorLoopSleepPeriod: 1 * time.Minute, @@ -900,7 +900,7 @@ func (adc *attachDetachController) addNodeToDswp(node *v1.Node, nodeName types.N keepTerminatedPodVolumes := false if t, ok := node.Annotations[volumeutil.KeepTerminatedPodVolumesAnnotation]; ok { - keepTerminatedPodVolumes = (t == "true") + keepTerminatedPodVolumes = t == "true" } // Node specifies annotation indicating it should be managed by attach diff --git a/staging/src/k8s.io/apimachinery/pkg/util/errors/errors_test.go b/staging/src/k8s.io/apimachinery/pkg/util/errors/errors_test.go index 55d253bb20d..02386aa48dc 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/errors/errors_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/errors/errors_test.go @@ -93,7 +93,7 @@ func TestAggregateWithNil(t *testing.T) { } func TestSingularAggregate(t *testing.T) { - var slice []error = []error{fmt.Errorf("err")} + var slice = []error{fmt.Errorf("err")} var agg Aggregate var err error @@ -121,7 +121,7 @@ func TestSingularAggregate(t *testing.T) { } func TestPluralAggregate(t *testing.T) { - var slice []error = []error{fmt.Errorf("abc"), fmt.Errorf("123")} + var slice = []error{fmt.Errorf("abc"), fmt.Errorf("123")} var agg Aggregate var err error @@ -149,7 +149,7 @@ func TestPluralAggregate(t *testing.T) { } func TestDedupeAggregate(t *testing.T) { - var slice []error = []error{fmt.Errorf("abc"), fmt.Errorf("abc")} + var slice = []error{fmt.Errorf("abc"), fmt.Errorf("abc")} var agg Aggregate agg = NewAggregate(slice) @@ -165,7 +165,7 @@ func TestDedupeAggregate(t *testing.T) { } func TestDedupePluralAggregate(t *testing.T) { - var slice []error = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), fmt.Errorf("123")} + var slice = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), fmt.Errorf("123")} var agg Aggregate agg = NewAggregate(slice) @@ -181,7 +181,7 @@ func TestDedupePluralAggregate(t *testing.T) { } func TestFlattenAndDedupeAggregate(t *testing.T) { - var slice []error = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), NewAggregate([]error{fmt.Errorf("abc")})} + var slice = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), NewAggregate([]error{fmt.Errorf("abc")})} var agg Aggregate agg = NewAggregate(slice) @@ -197,7 +197,7 @@ func TestFlattenAndDedupeAggregate(t *testing.T) { } func TestFlattenAggregate(t *testing.T) { - var slice []error = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), NewAggregate([]error{fmt.Errorf("abc"), fmt.Errorf("def"), NewAggregate([]error{fmt.Errorf("def"), fmt.Errorf("ghi")})})} + var slice = []error{fmt.Errorf("abc"), fmt.Errorf("abc"), NewAggregate([]error{fmt.Errorf("abc"), fmt.Errorf("def"), NewAggregate([]error{fmt.Errorf("def"), fmt.Errorf("ghi")})})} var agg Aggregate agg = NewAggregate(slice) diff --git a/staging/src/k8s.io/apiserver/pkg/admission/attributes_test.go b/staging/src/k8s.io/apiserver/pkg/admission/attributes_test.go index 6579bb06763..c25776e6d3a 100644 --- a/staging/src/k8s.io/apiserver/pkg/admission/attributes_test.go +++ b/staging/src/k8s.io/apiserver/pkg/admission/attributes_test.go @@ -39,7 +39,7 @@ func TestAddAnnotation(t *testing.T) { assert.Equal(t, annotations["foo.admission.k8s.io/key1"], "value1", "admission annotations should not be overwritten") // test invalid plugin names - var testCases map[string]string = map[string]string{ + var testCases = map[string]string{ "invalid dns subdomain": "INVALID-DNS-Subdomain/policy", "no plugin name": "policy", "no key name": "foo.admission.k8s.io", diff --git a/test/e2e/cloud/gcp/addon_update.go b/test/e2e/cloud/gcp/addon_update.go index 42e4d2bc0cc..e505ae12789 100644 --- a/test/e2e/cloud/gcp/addon_update.go +++ b/test/e2e/cloud/gcp/addon_update.go @@ -267,7 +267,7 @@ var _ = SIGDescribe("Addon update", func() { svcAddonEnsureExists := "addon-ensure-exists-service.yaml" svcAddonEnsureExistsUpdated := "addon-ensure-exists-service-updated.yaml" - var remoteFiles []stringPair = []stringPair{ + var remoteFiles = []stringPair{ {fmt.Sprintf(reconcileAddonController, addonNsName, serveHostnameImage), rcAddonReconcile}, {fmt.Sprintf(reconcileAddonControllerUpdated, addonNsName, serveHostnameImage), rcAddonReconcileUpdated}, {fmt.Sprintf(deprecatedLabelAddonService, addonNsName), svcAddonDeprecatedLabel}, diff --git a/test/e2e/windows/cpu_limits.go b/test/e2e/windows/cpu_limits.go index 6dd54839def..68cde5ee810 100644 --- a/test/e2e/windows/cpu_limits.go +++ b/test/e2e/windows/cpu_limits.go @@ -52,7 +52,7 @@ var _ = SIGDescribe("[Feature:Windows] Cpu Resources [Serial]", func() { ginkgo.By("Waiting 2 minutes") time.Sleep(2 * time.Minute) ginkgo.By("Ensuring pods are still running") - var allPods [](*v1.Pod) + var allPods []*v1.Pod for _, p := range podsDecimal { pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Get( ctx,