This commit is contained in:
Mike Schwörer 2023-04-08 19:39:13 +02:00
parent c266d9204b
commit c5e23ab451
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -381,3 +381,19 @@ func ArrCastToAny[T1 any](arr []T1) []any {
}
return r
}
func ArrConcat[T any](arr ...[]T) []T {
c := 0
for _, v := range arr {
c += len(v)
}
r := make([]T, c)
i := 0
for _, av := range arr {
for _, v := range av {
r[i] = v
i++
}
}
return r
}