Glossary: Go Beyond the Basics
cap / capacity
Also written: capacity, cap
How many elements a slice or channel has room for. `make([]int, 0, 10)` is empty but has capacity 10, and `cap` reports it.
Glossary: Go Beyond the Basics
Also written: capacity, cap
How many elements a slice or channel has room for. `make([]int, 0, 10)` is empty but has capacity 10, and `cap` reports it.