From 14f6d1ea97eeef158adf7db0e9b42206905930bf Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Mon, 2 Mar 2020 12:09:41 -0800 Subject: [PATCH] ref(environment): use string checking instead It is more idiomatic to compare the string against the empty string than to check the string's length. Signed-off-by: Matthew Fisher --- pkg/cli/environment.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cli/environment.go b/pkg/cli/environment.go index 1e3b23617..e279331b0 100644 --- a/pkg/cli/environment.go +++ b/pkg/cli/environment.go @@ -135,10 +135,10 @@ func (s *EnvSettings) Namespace() string { func (s *EnvSettings) RESTClientGetter() genericclioptions.RESTClientGetter { s.configOnce.Do(func() { clientConfig := kube.GetConfig(s.KubeConfig, s.KubeContext, s.namespace) - if len(s.KubeToken) > 0 { + if s.KubeToken != "" { clientConfig.BearerToken = &s.KubeToken } - if len(s.KubeAPIServer) > 0 { + if s.KubeAPIServer != "" { clientConfig.APIServer = &s.KubeAPIServer }