Skip to content
masterclass Buddy

Go · Function

maps.Keys

maps.Keys returns an iterator over a map's keys. The order is unspecified and may differ between calls.

Last updated

Since
go1.23.0

Syntax

func Keys[Map ~map[K]V, K comparable, V any](m Map) iter.Seq[K]

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • maps.Values
  • maps.All
  • slices.Sorted

Source: maps package - maps - Go Packages. Checked 2026-11-03.