Use make() to create a slice with a specific length and optional capacity:
s := make([]int, 5) // length 5, capacity 5
s := make([]int, 5, 10) // length 5, capacity 10
Length is how many elements the slice contains. Capacity is how many it can hold before needing to grow. Pre-allocating capacity avoids repeated memory allocations when you know approximately how many elements you'll need.