Skip to content

Commit e343af0

Browse files
oswaldom-codeOswaldo Montañosamber
authored
docs: add play link for ChunkEntries example in README (#600)
* docs: add play link for ChunkEntries example in README * Update map.go --------- Co-authored-by: Oswaldo Montaño <[email protected]> Co-authored-by: Samuel Berthe <[email protected]>
1 parent 38f6750 commit e343af0

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,7 @@ maps := lo.ChunkEntries(
13961396
// {"d": 4, "e": 5},
13971397
// }
13981398
```
1399+
[[play](https://go.dev/play/p/X_YQL6mmoD-)]
13991400

14001401
### MapKeys
14011402

map.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ func Assign[K comparable, V any, Map ~map[K]V](maps ...Map) Map {
249249

250250
// ChunkEntries splits a map into an array of elements in groups of a length equal to its size. If the map cannot be split evenly,
251251
// the final chunk will contain the remaining elements.
252+
// Play: https://go.dev/play/p/X_YQL6mmoD-
252253
func ChunkEntries[K comparable, V any](m map[K]V, size int) []map[K]V {
253254
if size <= 0 {
254255
panic("The chunk size must be greater than 0")

0 commit comments

Comments
 (0)