by voidlogic · 13y ago · 0 comments
Also some of the built-in types like channels and maps are reference types (so they are always passed by reference).
If they were passed by reference, then we would expect this playground snip to print "false": http://play.golang.org/p/r6naknvzng
When you pass a slice around are are really passing a small struct around by value (http://golang.org/pkg/reflect/#SliceHeader), and it is that struct that contains the pointer to the data.