mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
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
This commit is contained in:
@@ -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, ", ") + ")"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user