From 70da14d4e90bb736e5428da91a1a05fdfaddda81 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Tue, 1 Nov 2016 19:58:40 +0100 Subject: [PATCH] Mention that the append trick for copying fails on the empty slice --- SliceTricks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SliceTricks.md b/SliceTricks.md index 2df9de20..f34a66e7 100644 --- a/SliceTricks.md +++ b/SliceTricks.md @@ -11,7 +11,7 @@ a = append(a, b...) ```go b = make([]T, len(a)) copy(b, a) -// or +// or, if a is not the empty slice, b = append([]T(nil), a...) ```