Inspectopedia
 
2024.3

Mixed value and pointer receivers

Info
Code Style
New
Last modified: 03 December 2024

Reports structures with methods that use a mixture of types: value and pointer receivers. Such usage is not recommended by the Go Documentation.

For more information, refer to Should I define methods on values or pointers? in the Go FAQ.

Example: