---
title: "identical-binary-operands"
description: "Detect suspicious binary operations with identical operands."
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.

# identical-binary-operands

**Default severity:** `warning`

Comparisons and non-idempotent operations with identical expressions on both
sides are usually copy-and-paste mistakes. Floating-point expressions are
excluded because `NaN` makes self-comparisons meaningful.

## Bad

```go
if left == left { use() }
```

## Good

```go
if left == right { use() }
```

Source: https://strider.gempir.com/analyzers/identical-binary-operands/index.mdx
