Home | History | Annotate | Download | only in sort

Lines Matching defs:Sort

9 	"sort"
26 // Sort is a method on the function type, By, that sorts the argument slice according to the function.
27 func (by By) Sort(planets []Planet) {
30 by: by, // The Sort method's receiver is the function (closure) that defines the sort order.
32 sort.Sort(ps)
41 // Len is part of sort.Interface.
46 // Swap is part of sort.Interface.
51 // Less is part of sort.Interface. It is implemented by calling the "by" closure in the sorter.
63 // ExampleSortKeys demonstrates a technique for sorting a struct type using programmable sort criteria.
79 // Sort the planets by the various criteria.
80 By(name).Sort(planets)
83 By(mass).Sort(planets)
86 By(distance).Sort(planets)
89 By(decreasingDistance).Sort(planets)