From 7680e3d079d757e1cbe76281b33b5abd88532f7c Mon Sep 17 00:00:00 2001 From: Sean Malloy Date: Wed, 10 Jun 2020 01:05:05 -0500 Subject: [PATCH] Use var declaration instead of short assignmnet This is a very minor refactor to use a var declaration for the reason variable. A var declaration is being used because the zero value for strings is an empty string. https://golang.org/ref/spec#The_zero_value --- pkg/descheduler/evictions/evictions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/descheduler/evictions/evictions.go b/pkg/descheduler/evictions/evictions.go index 0a7110ad6..bde3186a5 100644 --- a/pkg/descheduler/evictions/evictions.go +++ b/pkg/descheduler/evictions/evictions.go @@ -126,7 +126,7 @@ func (pe *PodEvictor) TotalEvicted() int { // possible (due to maxPodsToEvict constraint). Success is true when the pod // is evicted on the server side. func (pe *PodEvictor) EvictPod(ctx context.Context, pod *v1.Pod, node *v1.Node, reasons ...string) (bool, error) { - reason := "" + var reason string if len(reasons) > 0 { reason = " (" + strings.Join(reasons, ", ") + ")" }