我正在尝试将切片[1, 2]和切片结合起来[3, 4]。如何在Go中执行此操作?
我试过了:
append([]int{1,2}, []int{3,4})但得到:
cannot use []int literal (type []int) as type int in append但是,文档似乎表明这是可能的,我想念的是什么?
slice = append(slice, anotherSlice…)