package main
import "fmt"
func main() {
arr := []int{1, 2, 3, 4, 5, 6}
index := 2 // Index of the element to remove
newArr := make([]int, 0, len(arr) - 1)
for i, v := range arr {
if i != index {
newArr = append(newArr, v)
}
}
fmt.Println(newArr)
}
/*
run:
[1 2 4 5 6]
*/