From 7b63b7c9d03b23f496ec9bfb8e91be3693b19a8f Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Sun, 26 Feb 2023 09:37:30 +0000 Subject: Replace append with walk.ConcatData in many places to fix bug to do with semantics of append When doing append, be very careful as it does make changes in place to the underlying array of the slice which may affect other slices --- walk/walk.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'walk/walk.go') diff --git a/walk/walk.go b/walk/walk.go index 30bfb29..a9b40b7 100644 --- a/walk/walk.go +++ b/walk/walk.go @@ -373,3 +373,7 @@ func JsonOut(in chan WalkItem) { } fmt.Print("\n") } + +func ConcatData(first []Datum, second []Datum) []Datum { + return append(append([]Datum(nil), first...), second...) +} -- cgit v1.2.3