Immediately appending to a slice initialized with a non-zero length will lead to a slice which is twice as large as intended, with the initial half of the entries being left at their zero value.
This is fixed by initializing the slice with capacity instead of length.
Immediately appending to a slice initialized with a non-zero length will lead to a slice which is twice as large as intended, with the initial half of the entries being left at their zero value.
This is fixed by initializing the slice with capacity instead of length.