Last Updated: May 22, 2026
The maps package, added in Go 1.21 and expanded in Go 1.23, gives you a small set of generic functions that work on any map[K]V. Before it existed, every Go project carried its own handwritten copy of cloneMap, mergeMap, and mapKeys, all subtly different. The package replaces those with a tested, type-safe API and integrates with the new iter sequences so you can stream entries instead of materializing slices.