---
title: "unchanged-loop-condition"
description: "Detect counted loops whose condition variable never changes."
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.

# unchanged-loop-condition

**Default severity:** `warning`

A conventional three-part loop that initializes and tests one variable but
never changes that variable cannot progress as intended. This often means the
post statement increments the wrong counter or is unreachable.

## Bad

```go
for index := 0; index < limit; other++ { use(index) }
```

## Good

```go
for index := 0; index < limit; index++ { use(index) }
```

Source: https://strider.gempir.com/analyzers/unchanged-loop-condition/index.mdx
