Re:Go 1.1 is released
by chrisguitarguy on Monday May 13, 2013 @09:46PM
(#5702609)
> So it's like PHP where I need to pass in `function modify(&$foo) {` to modify a variable passed by reference.
If you're thinking in terms of PHP's primitive types, then yes: that's probably the best equivalent. PHP has the whole objects always being "passed by reference" [0] thing going on too.
It's also a performance boost when you're passing something non-trivial, to pass just the pointer, rather than have Go make a copy of whatever you're passing by value.
=============================
So it's like PHP where I need to pass in `function modify(&$foo) {` to modify a variable passed by reference.