What problem does it solve?
This Skill helps Go engineers pick and implement the correct data structures by reasoning about memory layout, allocation and growth behavior, and real-world performance tradeoffs.
Core Features & Use Cases
- Slice internals and capacity strategy: explains slice headers, backing-array sharing, growth costs, and when to preallocate or use slices utilities.
- Map internals and performance: covers bucketed hash table behavior, preallocation to avoid rehashing, and practical guidance on map usage patterns.
- Standard containers and string/data building: guides when to use container/list, container/heap, container/ring, bufio, strings.Builder vs bytes.Buffer, plus generics and pointer safety.
- Safety-focused pitfalls: highlights common bugs like append aliasing, defensive copying needs, unsafe.Pointer usage rules, nil map traps, and GC-safe weak.Pointer cache patterns.
Quick Start
Use the golang-data-structures skill to help you decide whether to use a slice vs array, a map vs pointer-to-map value, or container/heap vs a custom structure for a given hot-path in a Go service.