func Sorter(v interface{}) sort.Interface {
	switch v := v.(type) {
	case []int:
		return sort.IntSlice(v)
	case []float64:
		return sort.Float64Slice(v)
	case []string:
		return sort.StringSlice(v)
	case []time.Time:
		return sortTimeSlice(v)
	case sort.Interface:
		return v
	}
	rv := reflectSlice(v)
	switch rv.Type().Elem().Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return sortIntSlice{rv}
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		return sortUintSlice{rv}
	case reflect.Float32, reflect.Float64:
		return sortFloatSlice{rv}
	case reflect.String:
		return sortStringSlice{rv}
	}
	panic(&generic.TypeError{rv.Type().Elem(), nil, "is not orderable"})
}
Sorter returns a sort.Interface for sorting v. v must implement
sort.Interface, be a slice whose elements are orderable, or be a
[]time.Time.
package slice
import (
	"reflect"
	"sort"
	"time"
	"github.com/aclements/go-gg/generic"
)
func CanSort(v interface{}) bool {
	switch v.(type) {
	case sort.Interface, []time.Time:
		return true
	}
	return generic.CanOrderR(reflect.TypeOf(v).Elem().Kind())
}
func Sort(v interface{}) {
	sort.Sort(Sorter(v))
}