Golang Tutorial: Slice length vs. capacity
TL;DR: The slice length is the number of available elements in the slice, whereas the slice capacity is the number of elements in the backing array, counting from the first element in the slice. It’s common for Go developers to mix slice length and capacity or not understand them thoroughly. Assimilating these two concepts is […]