Open jcnars opened 11 months ago
Ah !
I see where I got it mixed up.
The *T
(as in *int
) is simply a type that represents a pointer to base type T
(int
).
There is also this *t
which represents the value at address/pointer t
.
This was beautifully explained in this video: https://youtu.be/sTFJtxJXkaY?si=K2OTwhlDLDpfU5Ro
I wonder if the tour.go.dev pointer page be slightly modified with this aha moment.
Context: https://go.dev/tour/moretypes/1
Change the title above to describe your issue and add your feedback here, including code if necessary
By:
My mind constructed it to mean: *T is a pointer to a T value... When in fact &T is a pointer to a T.
The text following it explains stuff, but still the first reading didn't sit well. Maybe it's just me and you can ignore this.