📜  golang list pop - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:34.132000             🧑  作者: Mango

代码示例1
xs := []int{1, 2, 3, 4, 5}

i := 0 // Any valid index, however you happen to get it.
x := xs[i]
xs = append(xs[:i], xs[i+1:]...)
// Now "x" is the ith element and "xs" has the ith element removed.