CatTail
11/17/2014 - 5:33 AM

Remove element from slice

Remove element from slice

func remove(array []interface{}, index int) []interface{} {
	if index < 0 || index > len(array) {
		return array
	}
	return append(array[0:index], array[index+1:]...)
}