---
title: "address-nil-comparison"
description: "Detect comparisons between a freshly taken address and nil."
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.

# address-nil-comparison

**Default severity:** `warning`

Taking the address of an addressable value produces a non-nil pointer whenever
evaluation completes, so comparing that address with `nil` has a fixed result.

The `&*pointer` form is excluded because it simplifies to `pointer`, which may
legitimately be nil.

## Bad

```go
if &value == nil { handle() }
```

## Good

```go
if pointer == nil { handle() }
```

Source: https://strider.gempir.com/analyzers/address-nil-comparison/index.mdx
