Arrays, slices (and strings): The mechanics of 'append'
Official deep dive into append mechanics, growth behavior, and how slices relate to arrays and strings.
Official deep dive into append mechanics, growth behavior, and how slices relate to arrays and strings.
- Author: Rob Pike
- Authority: primary
- Kind: blog
- URL: https://go.dev/blog/slices
What it covers
- append mechanics
- slice growth behavior
- array-slice relationship
Why authoritative
Official Go blog deep dive on append semantics and slice mechanics.
Use when
- how does append work in Go
- when does append reallocate in Go
- why did this append mutate another slice in Go
Keywords
- append, slices, arrays, capacity growth, backing array