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

27 lines
583 B
Markdown

---
name: Concat
slug: concat
sourceRef: slice.go#L282
category: core
subCategory: slice
playUrl: https://go.dev/play/p/Ux2UuR2xpRK
variantHelpers:
- core#slice#concat
similarHelpers:
- it#sequence#concat
- core#slice#flatten
- core#intersection#union
position: 160
signatures:
- "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.
```go
list1 := []int{0, 1}
list2 := []int{2, 3, 4, 5}
flat := lo.Flatten(list1, list2)
// []int{0, 1, 2, 3, 4, 5}
```