Get length and capacity with built-in functions:
nums := make([]int, 5, 10)
fmt.Println(len(nums)) // 5
fmt.Println(cap(nums)) // 10
Length is how many elements are accessible. Capacity is how many can fit before reallocation. Length is always less than or equal to capacity.