remove an element in an array in go code example
Example 1: golang delete element from array
func RemoveIndex(s []string, index int) []string {
return append(s[:index], s[index+1:]...)
}
Example 2: go delete from slice
func remove(slice []int, s int) []int {
return append(slice[:s], slice[s+1:]...)
}