diff --git a/goextVersion.go b/goextVersion.go index 3522582..9aa9e67 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ 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" diff --git a/langext/array.go b/langext/array.go index dcb4a87..779b025 100644 --- a/langext/array.go +++ b/langext/array.go @@ -453,6 +453,15 @@ func ArrConcat[T any](arr ...[]T) []T { 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 func ArrCopy[T any](in []T) []T { out := make([]T, len(in))