---
title: "overwritten-before-use"
description: "Detect assigned values that are replaced before being used."
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.

# overwritten-before-use

**Default severity:** `warning`

A non-constant value assigned to a local variable but never read is often a
forgotten error check or dead computation. The check follows values through
control-flow joins and separately tracks each result of multi-value calls.

## Bad

```go
result := calculate(); result = calculateAgain()
```

## Good

```go
result := calculate(); use(result); result = calculateAgain()
```

Source: https://strider.gempir.com/analyzers/overwritten-before-use/index.mdx
