Skip to content

empty-conditional-block

Default severity: error

Catch empty if and else branches that are usually unfinished code or accidental no-ops.

Empty functions, methods, closures, and loop bodies are accepted because they are commonly intentional stubs, marker methods, callbacks, or drain loops and have different semantics from an empty conditional branch.

if err != nil {
}
if err != nil {
return err
}