Home >Backend Development >Golang >Passing of reference type parameters in golang
In Go language, variable names are used directly when passing reference type parameters without pointers.
In Go language, function parameters can be value types or reference types. Value types make a copy when a function is called, while reference types pass a reference to the underlying data.
Passing reference type parameters
To pass reference type parameters, you only need to specify the variable name as a parameter, without using a pointer (*). For example:
type Book struct {
The above is the detailed content of Passing of reference type parameters in golang. For more information, please follow other related articles on the PHP Chinese website!