3 ms·
I never used Go in any meaningful way so I just had to look at the documentation. I lean towards classifying it as references instead of pointers despite the na
by danbruc 9y ago
I never used Go in any meaningful way so I just had to look at the documentation. I lean towards classifying it as references instead of pointers despite the name. References to references are perfectly valid even though they are not available in all languages with references.
On the other hand Go exposes an implementation detail, the fact that references are implemented as addresses. This is probably true for most languages with references but they usually keep this an implementation detail so that it would be perfectly valid to implement references with something other then addresses.
But because you can not really take advantage of the fact that references are implemented using addresses, you can not manipulate them and it seems you can not even calculate the difference between two pointers unless you go through unsafe, I would call it references [with slightly but inconsequentially exposed implementation].
As said, this is based on a ten minute read through the first couple of search results and I probably have not even hit any official documentation, so this might very well miss something important and be wrong.