Skip to content

Commit 2f61fad

Browse files
committed
replace len(x)<=0 with len(x)==0
length can't be negative. Found using https://go-critic.github.io/overview#sloppyLen-ref
1 parent 5fb530c commit 2f61fad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/gosec/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func main() {
262262

263263
// Load enabled rule definitions
264264
ruleDefinitions := loadRules(*flagRulesInclude, *flagRulesExclude)
265-
if len(ruleDefinitions) <= 0 {
265+
if len(ruleDefinitions) == 0 {
266266
logger.Fatal("cannot continue: no rules are configured.")
267267
}
268268

0 commit comments

Comments
 (0)