From: Gabriel Aszalos Date: Mon, 18 Sep 2017 14:51:15 +0000 (+0200) Subject: doc: simplify Append example in "Effective Go" X-Git-Tag: go1.10beta1~1076 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c40579ac75b7fe012097af46c4e3dd7fbd291311;p=gostls13.git doc: simplify Append example in "Effective Go" Change-Id: I011486993b167e65c69da1c8390bbcc625ca58c3 Reviewed-on: https://go-review.googlesource.com/64331 Reviewed-by: Rob Pike --- diff --git a/doc/effective_go.html b/doc/effective_go.html index 731959e408..6d53eefbc3 100644 --- a/doc/effective_go.html +++ b/doc/effective_go.html @@ -1431,9 +1431,7 @@ func Append(slice, data []byte) []byte { slice = newSlice } slice = slice[0:l+len(data)] - for i, c := range data { - slice[l+i] = c - } + copy(slice[l:], data) return slice }