From a591a838e5471e186a0153b80a0be32fde4b8b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80b=C3=A9j=C3=ADd=C3=A9=20=C3=80yod=C3=A9l=C3=A9?= Date: Wed, 1 May 2019 16:23:28 +0000 Subject: [PATCH] Clean up controller-manager. These are based on recommendation from [staticcheck](http://staticcheck.io/). --- cmd/controller-manager/app/options/generic.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/controller-manager/app/options/generic.go b/cmd/controller-manager/app/options/generic.go index 9491ec0a745..59dc6784467 100644 --- a/cmd/controller-manager/app/options/generic.go +++ b/cmd/controller-manager/app/options/generic.go @@ -103,9 +103,7 @@ func (o *GenericControllerManagerConfigurationOptions) Validate(allControllers [ if controller == "*" { continue } - if strings.HasPrefix(controller, "-") { - controller = controller[1:] - } + controller = strings.TrimPrefix(controller, "-") if !allControllersSet.Has(controller) { errs = append(errs, fmt.Errorf("%q is not in the list of known controllers", controller)) }