Chris Siebenmann: Converting a Go pointer to an integer doesn't quite do what it looks like

Published: 18/09/2019
Chris Siebenmann: Converting a Go pointer to an integer doesn't quite do what it looks like
Source: UTCC.UTORONTO.CA

Over on r/golang, an interesting question was asked : [Is it] possible to parse a struct or interface to get its pointer address as an integer? [...] The practical answer today is yes, as noted in the answers to the question. You can convert any Go pointer to uintptr by going through unsafe.Pointer() , and then convert the uintptr into some more conventional integer type if you want. If you're go

Read more
Related news
Comment
FACEBOOK