Referencing values with pointers in Go

import (
    "fmt"
)

func main() {
    var p *int
    var v int = 42

    // put memory address of v in p
    p = &v

    // print memory address of v
    fmt.Println(p)

    // print value of v
    fmt.Println(*p)

    // change value of v by changing pointer value
    *p = 50

    // print value of p
    fmt.Println(v)
}