Automatic Slice Growth

2025-01-153 minTech Related
#golang

append() resizes slices automatically.

Slices grow automatically.

Example:

s := []int{}
for i := 0; i < 100; i++ {
    s = append(s, i)
}