SyntaxFix
Write A Post
Hire A Developer
Questions
The best way to do it is to use the append function:
package main import ( "fmt" ) func main() { x := []int{4, 5, 6, 7, 88} fmt.Println(x) x = append(x[:2], x[4:]...)//deletes 6 and 7 fmt.Println(x) }
https://play.golang.org/p/-EEFCsqse4u