mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
1.9 KiB
1.9 KiB
name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | playUrl | variantHelpers | similarHelpers | position | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ZipByX | zipbyx | tuples.go#L335 | core | tuple |
|
https://go.dev/play/p/wlHur6yO8rR |
|
|
30 |
Zips multiple slices and projects each grouped set through a function. Variants support 2 up to 9 input slices.
Variants: ZipBy2..ZipBy9
xs := []int{1,2}
ys := []string{"a","b"}
pairs := lo.ZipBy2(xs, ys, func(x int, y string) string {
return fmt.Sprintf("%d-%s", x, y)
})