News for hackers. Stuff that matters.
Re:Go 1.1 is released by coldtea on Monday May 13, 2013 @09:49PM (#5702618)
>There are no reference types in Go, everything in Go is passed by value.

Yes, but this value is not the ACTUAL value (e.g the underlying storage).

When people (especially newcomers to pointers like the person that started this thread) speak of "pass by value" they refer to their data (the actual value).

So that Go passes _the structure_ by value is quite misleading, compared to the expectation of what "pass by value" means.

For practical purposes, I think they're better off to think of it as a reference.

Re:Go 1.1 is released by voidlogic on Monday May 13, 2013 @11:31PM (#5702885)
>>For practical purposes, I think they're better off to think of it as a reference.

No, they should learn to understand what is actually happening. Otherwise things, at best, do not make sense and, at worst, can lead to bugs when using functions like append(): http://play.golang.org/p/eTJXu6XMNJ