lo icon indicating copy to clipboard operation
lo copied to clipboard

feat: add MergeSlices

Open iFurySt opened this issue 2 years ago • 0 comments

MergeSlice merges multiple slices without removing duplicates or shuffling the elements

result1 := lo.MergeSlice[int]([]int{1, 4, 7}, []int{2, 5, 8}, []int{3, 6, 9})
result2 := lo.MergeSlice[int]([]int{1}, []int{2, 5, 8}, []int{3, 6}, []int{4, 7, 9, 10})

fmt.Println(result1)
// []int{1 4 7 2 5 8 3 6 9}

fmt.Println(result2)
// []int{1 2 5 8 3 6 4 7 9 10}

iFurySt avatar Jul 18 '23 11:07 iFurySt