I'm looking for a proper way to implement a set of pointers to struct
. The obvious method is the of use built-in map
:
map[*SomeStructure]struct{}
But does Go memory model guarantees that it's safe to use pointers as map
key type?
Isn't it possible for runtime to optimize pointer addresses out (may be) due to address space defragmentation?