24. Feature diff matrix
One-liner. One grid for "which version gave me this", so you stop guessing.
Memorize
| Feature | 1.18 | 1.19 | 1.20 | 1.21 | 1.22 | 1.23 | 1.24 |
|---|---|---|---|---|---|---|---|
Generics, any | ✓ | ||||||
| Native fuzzing | ✓ | ||||||
Workspaces (go.work) | ✓ | ||||||
GOMEMLIMIT | ✓ | ||||||
Typed atomics (atomic.Int64) | ✓ | ||||||
| PGO | preview | default | improved | ||||
errors.Join, multiple %w | ✓ | ||||||
unsafe.String/SliceData | ✓ | ||||||
min/max/clear builtins | ✓ | ||||||
log/slog | ✓ | ||||||
slices/maps/cmp | ✓ | ||||||
| Loop var per-iteration | ✓ | ||||||
range over int | ✓ | ||||||
math/rand/v2 | ✓ | ||||||
Range-over-func / iter | ✓ | ||||||
unique interning | ✓ | ||||||
| Swiss-table maps | ✓ | ||||||
weak pointers | ✓ | ||||||
os.Root | ✓ | ||||||
tool directive | ✓ | ||||||
testing/synctest | ✓ | ||||||
runtime.AddCleanup | ✓ | ||||||
| Generic type aliases | preview |
- "Preview" means behind
GOEXPERIMENTor opt-in; "default" means it ships on. - Anything not in the grid is a library addition, not a language/runtime change.
Trap. Assuming a feature you use is old because it feels natural — generics are 1.18+, slices is 1.21+. Do this. Check the go directive before using new stdlib in a shared module.
Check
Which release introduced slices and maps in the standard library?
Why
1.21 added slices, maps and cmp alongside min/max/clear; earlier code used golang.org/x/exp/slices.