Skip to content

ineffective-pointer-copy

Default severity: error

Go simplifies &*pointer to pointer and *&value to value. Neither form copies the underlying data, so code using one as a copy operation is misleading and usually incorrect.

copy := &*pointer
copy := *pointer