From 2f61fad317efd05523c307ccddf5c195852dc9af Mon Sep 17 00:00:00 2001 From: Iskander Sharipov Date: Sat, 28 Jul 2018 23:16:16 +0300 Subject: [PATCH] replace len(x)<=0 with len(x)==0 length can't be negative. Found using https://go-critic.github.io/overview#sloppyLen-ref --- cmd/gosec/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gosec/main.go b/cmd/gosec/main.go index 3d6479a..f6c3724 100644 --- a/cmd/gosec/main.go +++ b/cmd/gosec/main.go @@ -262,7 +262,7 @@ func main() { // Load enabled rule definitions ruleDefinitions := loadRules(*flagRulesInclude, *flagRulesExclude) - if len(ruleDefinitions) <= 0 { + if len(ruleDefinitions) == 0 { logger.Fatal("cannot continue: no rules are configured.") }