Back to Lo

Core Chunkentries

docs/data/core-chunkentries.md

1.53.0232 B
Original Source

Splits a map into maps of at most the given size. The last chunk may be smaller.

go
chunks := lo.ChunkEntries(map[string]int{"a":1, "b":2, "c":3, "d":4, "e":5}, 3)
// []map[string]int{ {"a":1, "b":2, "c":3}, {"d":4, "e":5} }