Files
lo/docs/data/core-interleave.md
T
Samuel Berthe fa095e4b4f fix(doc): fix go playground demo URL (#832)
* fix(doc): fix go playground demo URL

* fix(doc): add more go playground demo URL
2026-03-06 00:09:59 +01:00

694 B

name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
name slug sourceRef category subCategory playUrl variantHelpers similarHelpers position signatures
Interleave interleave slice.go#L282 core slice https://go.dev/play/p/KOVtGUt-tdI
core#slice#interleave
core#slice#flatten
core#slice#chunk
core#slice#slice
core#slice#shuffle
170
func Interleave[T any, Slice ~[]T](collections ...Slice) Slice

Round-robins input slices by index, appending values sequentially into the result.

lo.Interleave([]int{1, 4, 7}, []int{2, 5, 8}, []int{3, 6, 9})
// []int{1, 2, 3, 4, 5, 6, 7, 8, 9}

lo.Interleave([]int{1}, []int{2, 5, 8}, []int{3, 6}, []int{4, 7, 9, 10})
// []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}