An Introduction To Generics
Introduces type parameters, constraints, and the core problem space generics are meant to solve.
Introduces type parameters, constraints, and the core problem space generics are meant to solve.
- Author: Robert Griesemer and Ian Lance Taylor
- Authority: primary
- Kind: blog
- URL: https://go.dev/blog/intro-generics
What it covers
- type parameter syntax
- constraints basics
- intended use cases for generics
Why authoritative
Official introduction from the designers of Go generics.
Use when
- how do Go generics work
- when should I use type parameters in Go
- what does this generic constraint mean
Keywords
- generics, type parameters, constraints, generic functions, generic types