package main
import (
"fmt"
)
func RemoveByIndex(slice []int, index int) []int {
return append(slice[:index], slice[index + 1:]...)
}
func main() {
slice := []int{4, 6, 12, 45, 98, 77, 32, 5, 1, 99, 100}
fmt.Println(slice)
slice = RemoveByIndex(slice, 6)
fmt.Println(slice)
}
/*
run:
[4 6 12 45 98 77 32 5 1 99 100]
[4 6 12 45 98 77 5 1 99 100]
*/