mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-13 20:16:30 +00:00
c28f7cb29f
Initial part of #435
727 B
727 B
nilerr
nilerr
finds code which returns nil even though it checks that error is not nil.
func f() error {
err := do()
if err != nil {
return nil // miss
}
}
nilerr
also finds code which returns error even though it checks that error is nil.
func f() error {
err := do()
if err == nil {
return err // miss
}
}
nilerr
ignores code which has a miss with ignore comment.
func f() error {
err := do()
if err != nil {
//lint:ignore nilerr reason
return nil // ignore
}
}