内置函数append()
slice := append([]int{1,2,3},4,5,6) fmt.Println(slice) //[1 2 3 4 5 6]slice := append([]int{1,2,3},[]int{4,5,6}...) fmt.Println(slice) //[1 2 3 4 5 6]bytes := append([]byte("hello"),"world"...)
Last updated
slice := append([]int{1,2,3},4,5,6)
fmt.Println(slice) //[1 2 3 4 5 6]slice := append([]int{1,2,3},[]int{4,5,6}...)
fmt.Println(slice) //[1 2 3 4 5 6]bytes := append([]byte("hello"),"world"...)Last updated