Copy slice to another slice:
|
|
copy
can be used over append
if want to keep length of target
slice intact. If the source slice is bigger in size than destination,
copy
only copies slice elements that occupies in target slice.
append
can be used (like an example below) instead of copy
if we
are unknown about the size of target slice and want to copy whole
slice to it:
|
|