package main
import (
"fmt"
"sort"
)
func main() {
numbers := []int{1, 2, 3, 4, 5}
isSorted := sort.SliceIsSorted(numbers, func(i, j int) bool {
return numbers[i] < numbers[j]
})
fmt.Println("Is the slice sorted?", isSorted)
}
/*
run:
Is the slice sorted? true
*/