package main import "fmt" type Point struct{ X, Y int } func moveRight(p *Point) { // p.X is shorthand for (*p).X p.X++ } func main() { p := Point{1, 2} moveRight(&p) fmt.Println(p.X) }
field access auto-dereferences