Go Slices: usage and internals
Official introduction to slice structure, sharing, length, capacity, and common usage patterns.
Official introduction to slice structure, sharing, length, capacity, and common usage patterns.
- Author: Andrew Gerrand
- Authority: primary
- Kind: blog
- URL: https://go.dev/blog/slices-intro
What it covers
- slice representation
- length and capacity
- sharing and subslice behavior
Why authoritative
Official Go blog explanation of slice structure and semantics.
Use when
- how do slices work in Go
- what are Go slice length and capacity
- why are these slices sharing data in Go
Keywords
- slices, length, capacity, backing array, aliasing