A value is assigned to a field, but its value is never read. This means that the assignment has no effect, and could indicate a logic error or incomplete code.
Examine the assignment closely to determine whether it is redundant, or whether it is perhaps a symptom of another bug.
The following example shows a simple
struct type wrapping an integer counter with a
reset that sets the counter to zero.
However, the receiver variable of
reset is declared to be of type
*counter, so the receiver value is passed into the method
by value, not by reference. Consequently, the method does not actually mutate its receiver as
To fix this, change the type of the receiver variable to