Re: [go-nuts] Behavior to copy the value of pointer inside another pointer

2021-08-04 Thread Olivier Szika
Oh Yes, Thanks! Le mercredi 4 août 2021 à 17:25:39 UTC+2, bse...@computer.org a écrit : > On Wed, Aug 4, 2021 at 9:18 AM Olivier Szika wrote: > >> Hi all, >> >> I am surprised by the behavior of "&(*var)". >> > > According to the language spec, pointer indirection is addressable: > > https://go

Re: [go-nuts] Behavior to copy the value of pointer inside another pointer

2021-08-04 Thread 'Axel Wagner' via golang-nuts
Yes. From the spec : For an operand x of pointer type *T, the pointer indirection *x denotes *the > variable* of type T pointed to by x. Emphasis mine. "The variable", means it really denotes the storage location that `x` points to. Not the value or

Re: [go-nuts] Behavior to copy the value of pointer inside another pointer

2021-08-04 Thread burak serdar
On Wed, Aug 4, 2021 at 9:18 AM Olivier Szika wrote: > Hi all, > > I am surprised by the behavior of "&(*var)". > According to the language spec, pointer indirection is addressable: https://golang.org/ref/spec#Address_operators Thus, taking the address of an indirection yields the original poin

[go-nuts] Behavior to copy the value of pointer inside another pointer

2021-08-04 Thread Olivier Szika
Hi all, I am surprised by the behavior of "&(*var)". https://play.golang.org/p/CK522lRkddd It is expected? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to gola