3 ms·
> Wouldn't it be more sensible to borrow the C notation -> ? No, because even in C, the operator `->`, like for instance, `pt->foo` it's just a shortcut for `(
by stefanos82 2y ago
> Wouldn't it be more sensible to borrow the C notation -> ?
No, because even in C, the operator `->`, like for instance, `pt->foo` it's just a shortcut for `(*pt).foo`; therefore in Go the aforementioned example `(*pt).foo` it's equivalent to `pt.foo`.
For more info, read https://tip.golang.org/ref/spec#Method_values https://tip.golang.org/ref/spec#Method_values where it talks about `selectors`.
- fithisux 2y agoThank you, I need to invest more time. Still, not persuaded (the dot does a lot) but the source you mentioned seems reasonable. Maybe I need to be more open minded.