3 ms·
I believe in Go, slices get passed by value so you shouldn't get garbage from passing them around. Also, it's a triple rather than a pair due to the capacity.
by skybrian 14y ago
I believe in Go, slices get passed by value so you shouldn't get garbage from passing them around. Also, it's a triple rather than a pair due to the capacity.
- carbocation 14y agoIn Go, a slice is a reference to a segment of an underlying array.
- skybrian 14y agoYes, but the reference (along with size information) is passed by value, so no garbage.