---
title: "redundant-atomic-result-assignment"
description: "Detect non-atomic operations on atomic values."
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.

# redundant-atomic-result-assignment

**Default severity:** `error`

Reports an atomic update whose returned value is assigned back to the same
variable. The assignment performs a second, non-atomic write and defeats the
purpose of the atomic operation.

## Bad

```go
counter = atomic.AddInt64(&counter, 1)
```

## Good

```go
atomic.AddInt64(&counter, 1)
```

Source: https://strider.gempir.com/lints/redundant-atomic-result-assignment/index.mdx
