copy是内置函数,用于从切片中复制数据(存在一种特殊情况即从字符串中复制到字符切片中),
源切片和目的切片可以重叠,返回复制的元素个数,等于源和目的的最小长度值。
func copy(dst, src []Type) int
The copy built-in function copies elements from a source slice into a
destination slice. (As a special case, it also will copy bytes from a
string to a slice of bytes.) The source and destination may overlap.
Copy returns the number of elements copied, which will be the minimum
of len(src) and len(dst).
参考文档: