Skip to content

ineffective-pointer-copy

Detect pointer round trips that do not copy values.

Updated View as Markdown

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.

Bad

copy := &*pointer

Good

copy := *pointer
Navigation

Type to search…

↑↓ navigate↵ selectEsc close