Go

Go

By DeepSource

Found empty body in an if or else branch SCC-SA9003

Anti-pattern
Autofix

Empty body in an if or else branch, so either remove this code or comment it out to keep the codebase clean.

Examples

Bad practice

if x > 0 {
    sum += x
} else {
    // empty block
}

Recommended

if x > 0 {
    sum += x
}