Pass Go Structs and Arrays as Pointers, Everything Else as Values
Don't Overthink It
At work, we recently started a discussion on when to pass function arguments as pointers (by reference) and when to pass by value. A related (but subtly different) question is whether to use pointer receivers or value receivers. Unfortunately, Go’s documentation and standard library aren’t clear on this point, and...
[Read More]