A nil slice and an empty slice are different:
var nilSlice []int // nil, len=0, cap=0
emptySlice := []int{} // not nil, len=0, cap=0
fmt.Println(nilSlice == nil) // true
fmt.Println(emptySlice == nil) // false
Both have length and behave similarly. Use nil slices unless you need a non-nil empty slice.