v0.0.425 ArrAppend
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m25s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m25s
This commit is contained in:
parent
9491b72b8d
commit
36b71dfaf3
@ -1,5 +1,5 @@
|
|||||||
package goext
|
package goext
|
||||||
|
|
||||||
const GoextVersion = "0.0.424"
|
const GoextVersion = "0.0.425"
|
||||||
|
|
||||||
const GoextVersionTimestamp = "2024-03-30T03:01:55+0100"
|
const GoextVersionTimestamp = "2024-03-30T14:24:53+0100"
|
||||||
|
@ -453,6 +453,15 @@ func ArrConcat[T any](arr ...[]T) []T {
|
|||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ArrAppend works similar to append(x, y, z) - but doe snot touch the old array and creates a new one
|
||||||
|
func ArrAppend[T any](arr []T, add ...T) []T {
|
||||||
|
r := ArrCopy(arr)
|
||||||
|
for _, v := range add {
|
||||||
|
r = append(r, v)
|
||||||
|
}
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
|
||||||
// ArrCopy does a shallow copy of the 'in' array
|
// ArrCopy does a shallow copy of the 'in' array
|
||||||
func ArrCopy[T any](in []T) []T {
|
func ArrCopy[T any](in []T) []T {
|
||||||
out := make([]T, len(in))
|
out := make([]T, len(in))
|
||||||
|
Loading…
Reference in New Issue
Block a user