package main import ( "fmt" ) func InsertSort(arr *[6]int) { for i := 1; i < len(arr); i++ { val := arr[i] index := i - 1 for index >= 0 && arr[index] > val { arr[index+1] = arr[index] index-- } if index + 1 == i { continue } arr[index+1] = val } } func main() { arr := [6]int{13,78,10,45,664,12} InsertSort(&arr) fmt.Println(arr) }