Go pointers

Go supports pointers, allowing you to pass references to values and records within your program.

The & syntax gives the memory address of the variable, while the * gives the value fo the variable.

package main
import "fmt"

var i int = 4

func main() {
	fmt.Println(i)
	fmt.Println(&i)
}
go run pointers.go
4
0x53e108