News for hackers. Stuff that matters.
Re:Go 1.1 is released by sergiotapia on Monday May 13, 2013 @07:34PM (#5702123)
>The very basic you need to know is: if a function argument is defined as (*foo), you are changing the item you pass to the function (like in Javascript or Java), whereas if it's defined as (foo), you're changing a copy of it and the original item remains unaffected.

=============================

So it's like PHP where I need to pass in `function modify(&$foo) {` to modify a variable passed by reference.

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.

0. http://php.net/manual/en/language.oop5.references.php

Re:Go 1.1 is released by dnm on Monday May 13, 2013 @09:38PM (#5702580)
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.
Re:Go 1.1 is released by coldtea on Monday May 13, 2013 @07:53PM (#5702210)
Yes, not sure for the whole PHP semantics on this, but it's a little like that.