4 ms·
Thanks for this. It gets weirder! The slice grows/doubles if capacity is insufficient. So if you initialize the original slice all the way to capacity (len=4, c
by innagadadavida 9y ago
Thanks for this. It gets weirder! The slice grows/doubles if capacity is insufficient. So if you initialize the original slice all the way to capacity (len=4, cap=4), it works correctly. But if len=3 and cap=4, it shows bad behavior.
https://play.golang.org/p/qf3lAoin4dM https://play.golang.org/p/qf3lAoin4dM