1
0
mirror of https://github.com/securego/gosec.git synced 2024-12-30 21:19:46 +02:00

replace len(x)<=0 with len(x)==0

length can't be negative.

Found using https://go-critic.github.io/overview#sloppyLen-ref
This commit is contained in:
Iskander Sharipov 2018-07-28 23:16:16 +03:00
parent 5fb530cda3
commit 2f61fad317

View File

@ -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.")
}