0
2
llucycodes42
func (a ) Greater(i, j int) bool { return a[i > a[j]] }
The type SortBy is an array of Type, and the three functions Len(), Swap(), and Less() take two int arguments and return an int. The function Greater() takes an int and a int and returns a bool.
Shortcut: sort
type SortBy []Type
func (a ) Len() int { return len(a) }
func (a ) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a ) Less(i, j int) bool { return a[i < a[j]] }