---
title: "ineffective-value-receiver-assignment"
description: "Detect field assignments that cannot escape a value receiver."
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.

# ineffective-value-receiver-assignment

**Default severity:** `warning`

A method with a value receiver modifies only its local receiver copy. When an
assigned field is never read afterward, the write has no observable effect and
often indicates that the method should use a pointer receiver.

The check follows field reads through the method's control-flow graph. It
does not report a local mutation that is subsequently read to compute a result.

## Bad

```go
func (item Item) Rename(name string) { item.Name = name }
```

## Good

```go
func (item *Item) Rename(name string) { item.Name = name }
```

Source: https://strider.gempir.com/analyzers/ineffective-value-receiver-assignment/index.mdx
