3 ms·
Since Go 1.23 you can do this: slices.Sorted(maps.Keys(m))
by meling 2y ago
Since Go 1.23 you can do this: slices.Sorted(maps.Keys(m))
- masklinn 2y agoOrdering generally denotes the preservation of insertion ordering, and possibly the alteration of that order. Sorted iteration is a completely different beast (and generally you’d use a tree-based collection if you need that).