I am new to go I want to print the address of struct variable in go here is my program
type Rect struct {
width int
name int
}
func main() {
r := Rect{4,6}
p := &r
p.width = 15
fmt.Println("-----",&p,r,p,&r)
}
output of this
_____0x40c130 {15 6} &{15 6} &{15 6}
but i want to print the address of r variable as i know that '&' represents the address and '*' points the value of pointer location but here i am unable to print the address of r, I am using online editor of go-lang https://play.golang.org/
As well I want to store this address in some variable.