Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
type SorterDefault []MyType
func (s SorterDefault) Len() int { return len(s)}
func (s SorterDefault) Swap(i, j int) { s[i], s[j] = s[j], s[i]}
type Sorter1 struct { SorterDefault }
func (s Sorter1) Less(i, j int) bool { ... }
type Sorter2 struct { SorterDefault }
func (s Sorter2) Less(i, j int) bool { ... }
type Sorter3 struct { SorterDefault }
func (s Sorter3) Less(i, j int) bool { ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment