---
title: "unnecessary-if"
description: "Replace boolean-returning if chains."
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.

# unnecessary-if

<!-- Code generated by docs/scripts/generate-check-docs.go; DO NOT EDIT. -->

**Default severity:** `warning`

Replace boolean-returning if chains.

## Bad

```go
if ready { return true } else { return false }
```

## Good

```go
return ready
```

Source: https://strider.gempir.com/lints/unnecessary-if/index.mdx
