When you pass a slice, for example, you are passing a structure that has a pointer to the underlying data by value; you could think of it as a reference BUT its not what you think it is. What you are passing around is actually a struct that is passed by value:
type SliceHeader struct { //[1]
Data uintptr
Len int
Cap int
}
1: http://golang.org/pkg/reflect/#SliceHeaderYes, 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.
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
Isn't this the exact definition of a reference type?