Hacker News new | past | comments | ask | show | jobs | submit login

There's really no such thing as pass by reference in Go. It's all pass by value. However, the value may be a pointer to other data that doesn't get copied. This is how pointers, maps, slices, and interfaces work (if you're passing an interface to another function that also takes an interface that is. If you're passing a non-interface value into a function that takes an interface, the value gets copied when it is wrapped in the interface... again, that value might be just a pointer or other small thing, or if you don't structure the code right, it might be a whole lot of data.. but usually it's not, because we write code specifically not to copy much data).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: