func SearchInt32s(a []int32, x int32) int {
	return sort.Search(len(a), func(i int) bool { return a[i] >= x })
}
SearchInt32s searches int32s; read about sort.Search for more.
package sortutil
import (
	"bytes"
	"math"
	"sort"
	"github.com/twotwotwo/sorts"
)
func Float32Key(f float32) uint64 {
	b := uint64(math.Float32bits(f)) << 32
	b ^= ^(b>>63 - 1) | (1 << 63)
	return b
}
func Float32Less(f, g float32) bool {
	return Float32Key(f) < Float32Key(g)
}
func Float64Key(f float64) uint64 {
	b := math.Float64bits(f)
	b ^= ^(b>>63 - 1) | (1 << 63)
	return b
}
func Float64Less(f, g float64) bool {
	return Float64Key(f) < Float64Key(g)
}
type IntSlice []int
func (p IntSlice) Len() int           { return len(p) }
func (p IntSlice) Less(i, j int) bool { return p[i] < p[j] }
func (p IntSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p IntSlice) Key(i int) int64 { return int64(p[i]) }
func (p IntSlice) Sort() { sorts.ByInt64(p) }
type Int32Slice []int32
func (p Int32Slice) Len() int           { return len(p) }
func (p Int32Slice) Less(i, j int) bool { return p[i] < p[j] }
func (p Int32Slice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p Int32Slice) Key(i int) int64 { return int64(p[i]) }
func (p Int32Slice) Sort() { sorts.ByInt64(p) }
type Int64Slice []int64
func (p Int64Slice) Len() int           { return len(p) }
func (p Int64Slice) Less(i, j int) bool { return p[i] < p[j] }
func (p Int64Slice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p Int64Slice) Key(i int) int64 { return p[i] }
func (p Int64Slice) Sort() { sorts.ByInt64(p) }
type UintSlice []uint
func (p UintSlice) Len() int           { return len(p) }
func (p UintSlice) Less(i, j int) bool { return p[i] < p[j] }
func (p UintSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p UintSlice) Key(i int) uint64 { return uint64(p[i]) }
func (p UintSlice) Sort() { sorts.ByUint64(p) }
type Uint32Slice []uint32
func (p Uint32Slice) Len() int           { return len(p) }
func (p Uint32Slice) Less(i, j int) bool { return p[i] < p[j] }
func (p Uint32Slice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p Uint32Slice) Key(i int) uint64 { return uint64(p[i]) }
func (p Uint32Slice) Sort() { sorts.ByUint64(p) }
type Uint64Slice []uint64
func (p Uint64Slice) Len() int           { return len(p) }
func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] }
func (p Uint64Slice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p Uint64Slice) Key(i int) uint64 { return p[i] }
func (p Uint64Slice) Sort() { sorts.ByUint64(p) }
type Float32Slice []float32
func (p Float32Slice) Len() int           { return len(p) }
func (p Float32Slice) Less(i, j int) bool { return Float32Less(p[i], p[j]) }
func (p Float32Slice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p Float32Slice) Key(i int) uint64 { return Float32Key(p[i]) }
func (p Float32Slice) Sort() { sorts.ByUint64(p) }
type Float64Slice []float64
func (p Float64Slice) Len() int           { return len(p) }
func (p Float64Slice) Less(i, j int) bool { return Float64Less(p[i], p[j]) }
func (p Float64Slice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p Float64Slice) Key(i int) uint64 { return Float64Key(p[i]) }
func (p Float64Slice) Sort() { sorts.ByUint64(p) }
type StringSlice []string
func (p StringSlice) Len() int           { return len(p) }
func (p StringSlice) Less(i, j int) bool { return p[i] < p[j] }
func (p StringSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p StringSlice) Key(i int) string { return p[i] }
func (p StringSlice) Sort() { sorts.ByString(p) }
type BytesSlice [][]byte
func (p BytesSlice) Len() int           { return len(p) }
func (p BytesSlice) Less(i, j int) bool { return bytes.Compare(p[i], p[j]) == -1 }
func (p BytesSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p BytesSlice) Key(i int) []byte { return p[i] }
func (p BytesSlice) Sort() { sorts.ByBytes(p) }
func Ints(a []int) { IntSlice(a).Sort() }
func Int32s(a []int32) { Int32Slice(a).Sort() }
func Int64s(a []int64) { Int64Slice(a).Sort() }
func Uints(a []uint) { UintSlice(a).Sort() }
func Uint32s(a []uint32) { Uint32Slice(a).Sort() }
func Uint64s(a []uint64) { Uint64Slice(a).Sort() }
func Float32s(a []float32) { Float32Slice(a).Sort() }
func Float64s(a []float64) { Float64Slice(a).Sort() }
func Strings(a []string) { StringSlice(a).Sort() }
func Bytes(a [][]byte) { BytesSlice(a).Sort() }
func IntsAreSorted(a []int) bool { return sort.IsSorted(IntSlice(a)) }
func Int32sAreSorted(a []int32) bool { return sort.IsSorted(Int32Slice(a)) }
func Int64sAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }
func UintsAreSorted(a []uint) bool { return sort.IsSorted(UintSlice(a)) }
func Uint32sAreSorted(a []uint32) bool { return sort.IsSorted(Uint32Slice(a)) }
func Uint64sAreSorted(a []uint64) bool { return sort.IsSorted(Uint64Slice(a)) }
func Float32sAreSorted(a []float32) bool { return sort.IsSorted(Float32Slice(a)) }
func Float64sAreSorted(a []float64) bool { return sort.IsSorted(Float64Slice(a)) }
func StringsAreSorted(a []string) bool { return sort.IsSorted(StringSlice(a)) }
func BytesAreSorted(a [][]byte) bool { return sort.IsSorted(BytesSlice(a)) }
func SearchInts(a []int, x int) int {
	return sort.Search(len(a), func(i int) bool { return a[i] >= x })
}
func (p IntSlice) Search(x int) int { return SearchInts(p, x) }