I know that pointers in Go allow mutation of a function\'s arguments, but wouldn\'t it have been simpler if they adopted just references (with appropriate const or mutable q
I really like example taken from http://www.golang-book.com/8
func zero(x int) { x = 0 } func main() { x := 5 zero(x) fmt.Println(x) // x is still 5 }
as contrasted with
func zero(xPtr *int) { *xPtr = 0 } func main() { x := 5 zero(&x) fmt.Println(x) // x is 0 }