What Are Pointers?
Address-of operator, dereferencing, nil pointers
Memory Addresses
Every variable lives at a memory address. A pointer stores that address. In Go, pointers are typed: a *int holds the address of an int.
Address-of Operator &
Use & to get the address of a variable:
package main
import "fmt"
func main() {
x := 42
p := &x
fmt.Println(p) // 0xc000... (address)
fmt.Println(*p) // 42 (value at address)
}