This is a rookie question, please bear with me. So the doubt is why f() function points different address. My understanding is the variable v must overwrite the old value.
package main
import "fmt"
var p = f()
func f() *int {
v := 1
return &v
}
func main() {
fmt.Println(f())
fmt.Println(f())
fmt.Println(f())
fmt.Println(p)
}
//0xc0000140b0
//0xc0000140b8
//0xc0000140e0
//0xc000014098