Files
lo/docs/data/core-concat.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

583 B

name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
name slug sourceRef category subCategory playUrl variantHelpers similarHelpers position signatures
Concat concat slice.go#L282 core slice https://go.dev/play/p/Ux2UuR2xpRK
core#slice#concat
it#sequence#concat
core#slice#flatten
core#intersection#union
160
func Concat[T any, Slice ~[]T](collections ...Slice) Slice

Returns a new slice containing all the elements in collections. Concat conserves the order of the elements.

list1 := []int{0, 1}
list2 := []int{2, 3, 4, 5}
flat := lo.Flatten(list1, list2)
// []int{0, 1, 2, 3, 4, 5}