4 ms·
One thing I definitely dislike are value/reference semantics, where arbitrary nested object structures are passed by value by default, but maps and slices are s
by sershe 8y ago
One thing I definitely dislike are value/reference semantics, where arbitrary nested object structures are passed by value by default, but maps and slices are somehow magical and are passed by reference. I don't even care which one it is, but either everything non-primitive should be by reference by default, or by value.
- hu3 8y agoNope. Everything is passed by value including maps and slices. Here's an article from 2011 that might help you understand that: https://blog.golang.org/go-slices-usage-and-internals https://blog.golang.org/go-slices-usage-and-internals