切片传递与指针传递到底有啥区别

机器铃砍菜刀 ·
##请记住,如果你只想修改切片中元素的值,而不会更改切片的容量与指向,则可以按值传递切片,否则你应该考虑按指针传递。## 我已经把重点给大家标出来了哈哈哈哈哈哈哈哈哈哈哈哈
#3
更多评论
If the backing array of s is too small to fit all the given values a bigger array will be allocated. The returned slice will point to the newly allocated array. —— FROM <A Tour of Go> . 原来如此
#1
薛定谔的切片,鉴定完毕
#2