Commit c40579ac authored by Gabriel Aszalos's avatar Gabriel Aszalos Committed by Rob Pike

doc: simplify Append example in "Effective Go"

Change-Id: I011486993b167e65c69da1c8390bbcc625ca58c3
Reviewed-on: https://go-review.googlesource.com/64331Reviewed-by: default avatarRob Pike <r@golang.org>
parent 8bdf0b72
...@@ -1431,9 +1431,7 @@ func Append(slice, data []byte) []byte { ...@@ -1431,9 +1431,7 @@ func Append(slice, data []byte) []byte {
slice = newSlice slice = newSlice
} }
slice = slice[0:l+len(data)] slice = slice[0:l+len(data)]
for i, c := range data { copy(slice[l:], data)
slice[l+i] = c
}
return slice return slice
} }
</pre> </pre>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment