2 ms·
"basically everything in Go is built on pointers: structs, slices, even fixed arrays" As I understand it while that does apply to pointer-to-struct and slices
by JulianMorrison 11y ago
"basically everything in Go is built on pointers: structs, slices, even fixed arrays"
As I understand it while that does apply to pointer-to-struct and slices and probably strings, that isn't true for naked structs and naked arrays. Those both behave as value types like int.
- jakub_h 11y agoTrue, one of the prime considerations for Go's design was that despite having pointers, structs could be embedded as values into other structs. That's the reason it doesn't look half like Java.