golang中切片slice的引用和地址问题
func main() { var t=make([]int,0,10) var s=make([]int,0,10) fmt.Printf("addr:%p \t\tlen:%v content:%v\n",t,len(t),t); fmt.Printf("addr:%p \t\tlen:%v content:%v\n",s,len(s),s); result: addr:0x1044c0...阅读全文
func main() { var t=make([]int,0,10) var s=make([]int,0,10) fmt.Printf("addr:%p \t\tlen:%v content:%v\n",t,len(t),t); fmt.Printf("addr:%p \t\tlen:%v content:%v\n",s,len(s),s); result: addr:0x1044c0...阅读全文