go基础第五篇:slice扩容
摘要:
x := []int{1, 2, 3, 4}y := x[:2]fmt.Println(cap(x), cap(y))y = append(y, 30) fmt.Println("x:", x)fmt.Println("y:", y) x := []int{1, 2, 3, 4}y := x[2:] 阅读全文
posted @ 2024-06-25 09:57 koushr 阅读(8) 评论(0) 推荐(0) 编辑