package main
import (
"fmt"
"sort"
)
func main() {
var arr = []int{1, 3, 2}
sort.SliceStable(arr, func(i, j int) bool {
return i > j
})
for _, val := range arr {
fmt.Println(val)
}
}
package main
import (
"fmt"
"sort"
)
func main() {
var arr = []int{1, 3, 2}
sort.SliceStable(arr, func(i, j int) bool {
return arr[i] > arr[j] // здесь поправил
})
for _, val := range arr {
fmt.Println(val)
}
}