On Wed, Aug 4, 2021 at 9:18 AM Olivier Szika <szika.oliv...@gmail.com>
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 pointer, not
a pointer to a copy of its contents.


>
> 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 golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/5f265699-ed67-4798-92d0-88832a7444d1n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/5f265699-ed67-4798-92d0-88832a7444d1n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAMV2Rqpi9WBCX1%3D4H2DGVbXCf%3DyQgWPGkUZn%3DiqH52TsfTas-g%40mail.gmail.com.

Reply via email to