﻿# V8041\. Modifying a field of a value receiver will have no effect\. Consider using a pointer receiver\.

The analyzer has detected a method that modifies the receiver field passed by value\. Such changes affect only a structure copy and do not affect the original object\.

The example:

```cpp
type Buffer struct {
  data []byte
}

func (b Buffer) Append(value byte) {
  b.data = append(b.data, value)
}
```

The `Append` method is declared with the `Buffer` receiver, which is passed by value\. A copy of the object is created each time the method is called, so the `b.data = append(b.data, value)` expression modifies only the field of that copy\. After the method execution is complete, the original object remains unchanged\.

If a method is supposed to modify an object, use a pointer receiver:

```cpp
func (b *Buffer) Append(value byte) {
  b.data = append(b.data, value)
}
```