package main
import (
"fmt"
)
func RemoveIndex(s []int, index int) []int {
return append(s[:index], s[index+1:]...)
}
func main() {
a := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
a = RemoveIndex(a, 9)
fmt.Println(a)
a = RemoveIndex(a, 6)
fmt.Println(a)
}
Output
[0 1 2 3 4 5 6 7 8]
[0 1 2 3 4 5 7 8]