A pointer is used to hold the address of a variable.
For example:
var x = 5 var p *int p = &x fmt.Printf("x = %d", *p) Here x can be accessed by *p.
var x = 5
var p *int
p = &x
fmt.Printf("x = %d", *p)
Here x can be accessed by *p.