doc: simplify Append example in "Effective Go"

Change-Id: I011486993b167e65c69da1c8390bbcc625ca58c3
Reviewed-on: https://go-review.googlesource.com/64331
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Gabriel Aszalos 2017-09-18 16:51:15 +02:00 committed by Rob Pike
parent 8bdf0b72b0
commit c40579ac75
1 changed files with 1 additions and 3 deletions

View File

@ -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
}
</pre>