---
title: "empty-conditional-block"
description: "Detect empty statement blocks that need removal or explanation."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# empty-conditional-block

**Default severity:** `error`

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

## Behavior

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.

## Bad

```go
if err != nil {
}
```

## Good

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

Source: https://strider.gempir.com/lints/empty-conditional-block/index.mdx
