@@ -231,7 +231,7 @@ func revokeCertificateAction(ctx *cli.Context) error {
231231
232232 // If cert and key are passed then infer the serial number and certificate
233233 // that should be revoked.
234- if len ( certFile ) > 0 || len ( keyFile ) > 0 {
234+ if certFile != "" || keyFile != "" {
235235 // Must be using cert/key flags for mTLS revoke so should be 0 cmd line args.
236236 if ctx .NArg () > 0 {
237237 return errors .Errorf ("'%s %s --cert <certificate> --key <key>' expects no additional positional arguments" , ctx .App .Name , ctx .Command .Name )
@@ -242,10 +242,10 @@ func revokeCertificateAction(ctx *cli.Context) error {
242242 if keyFile == "" {
243243 return errs .RequiredWithFlag (ctx , "cert" , "key" )
244244 }
245- if len ( token ) > 0 {
245+ if token != "" {
246246 errs .IncompatibleFlagWithFlag (ctx , "cert" , "token" )
247247 }
248- if len ( serial ) > 0 {
248+ if serial != "" {
249249 errs .IncompatibleFlagWithFlag (ctx , "cert" , "serial" )
250250 }
251251 var cert []* x509.Certificate
@@ -306,7 +306,7 @@ func newRevokeFlow(ctx *cli.Context, certFile, keyFile string) (*revokeFlow, err
306306 if err != nil {
307307 return nil , err
308308 }
309- if len ( certFile ) > 0 || len ( keyFile ) > 0 {
309+ if certFile != "" || keyFile != "" {
310310 if err := offlineClient .VerifyClientCert (certFile , keyFile ); err != nil {
311311 return nil , err
312312 }
@@ -332,7 +332,7 @@ func (f *revokeFlow) getClient(ctx *cli.Context, serial, token string) (cautils.
332332 rootFile := ctx .String ("root" )
333333 var options []ca.ClientOption
334334
335- if len ( token ) > 0 {
335+ if token != "" {
336336 tok , err := jose .ParseSigned (token )
337337 if err != nil {
338338 return nil , errors .Wrap (err , "error parsing flag '--token'" )
@@ -346,7 +346,7 @@ func (f *revokeFlow) getClient(ctx *cli.Context, serial, token string) (cautils.
346346 }
347347
348348 // Prepare client for bootstrap or provisioning tokens
349- if len ( claims .SHA ) > 0 && len (claims .Audience ) > 0 && strings .HasPrefix (strings .ToLower (claims .Audience [0 ]), "http" ) {
349+ if claims .SHA != "" && len (claims .Audience ) > 0 && strings .HasPrefix (strings .ToLower (claims .Audience [0 ]), "http" ) {
350350 if caURL == "" {
351351 caURL = claims .Audience [0 ]
352352 }
0 commit comments