difference between using pointer or value receiver types as arguments in go.


Golang value vs pointer receiver So how to choose between Pointer vs Value receiver? If you want to change the state of the receiver in a method, manipulating the value of it, use a pointer receiver. It's not possible with a value receiver, which copies by value. Any modification to a value receiver is local to that copy.

X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.