/AppendVector a = append(a, b...) //Copy b = make([]T, len(a)) copy(b, a) //Cut a = append(a[:i], a[j:]...) //Delete a = append(a[:i], a[i+1:]...) //Expand a = append(a[:i], append(make([]T, j), a[i:]...)...) //Extend a = append(a, make([]T, j)...) //Insert a = append(a[:i], append([]T{x}, a[i:]...)...) //InsertVector a = append(a[:i], append(b, a[i:]...)...) //Pop x = a[len(a)-1] a = a[:len(a)-1] //Push a = append(a, x)
有疑问加站长微信联系(非本文作者)