s := []int{0, 1, 2}
s2 := []int{3, 4, 5}
s = append(s, s2...)
fmt.Println(s) // [0 1 2 3 4 5]
Golang 切片(Slice)中追加切片
最新推荐文章于 2024-10-04 19:02:51 发布
s := []int{0, 1, 2}
s2 := []int{3, 4, 5}
s = append(s, s2...)
fmt.Println(s) // [0 1 2 3 4 5]