Hi all, there was a question on Reddit that has generated a discussion
where I am confused, and am hoping someone can clear up for me.
https://www.reddit.com/r/golang/comments/njejut/two_distinct_zerosized_variables_question/The
confusion I have is multiple pointers of different types (assuming
that's what is meant by one of the comments) being able to point to the
same address.
If the premise is correct, then I presume that there is some global "zero size" constant that pointers of different types can address?
If not, then how does it work (*much* appreciation will be given to links in the source that show me how it's actually done)
Or, if the premise is completely wrong, how /are/ zero sized values dealt with on the heap?
Also, I note in my answer on that page that there seems to be an optimisation for struct{} on the heap, but this doesn't seem to be happening for the stack, and I also note that I am *guessing* for the stack, can someone give me the definitive answer (or how to look it up)