go-nil-slice
Installation
SKILL.md
Slice Zero-Value
Problem
Nil slices are valid and usable, but behavior differs from empty slices.
Pattern
CORRECT - Nil slice works with append
var s []int // nil slice
s = append(s, 1, 2, 3) // OK, creates new backing array
fmt.Println(s) // [1 2 3]
Nil vs Empty Slice
var nilSlice []int // nil slice
emptySlice := []int{} // empty slice (non-nil)