go-generics

Installation
SKILL.md

Go Generics and Type Parameters

Compatibility: Generics require Go 1.18+.

Resource Routing

  • references/CONSTRAINTS.md - Read when composing constraints, using type sets, or choosing between generics and interfaces.

When to Use Generics

Start with concrete types. Generalize only when a second type appears.

Prefer Generics When

  • Multiple types share identical logic (sorting, filtering, map/reduce)
  • You would otherwise rely on any and excessive type switching
  • You are building a reusable data structure (concurrent-safe set, ordered map)

Avoid Generics When

Installs
561
GitHub Stars
126
First Seen
Mar 14, 2026
go-generics — cxuu/golang-skills