To be clear, Go does not have reference variables, so Go does not have pass-by-reference function call semantics. Dave Cheney
What is a reference variable?
In languages like C++ you can declare an alias, or an alternate name to an existing variable. This is called a reference variable.
| |
You can see that a, b, and c all refer to the same memory location. A write to a will alter the contents of b and c. This is useful when you want to declare reference variables in different scopes–namely function calls.