17 lines
258 B
Go
17 lines
258 B
Go
package Sync
|
|
|
|
type ByLength []string
|
|
|
|
func (s ByLength) Len() int {
|
|
return len(s)
|
|
}
|
|
|
|
func (s ByLength) Swap(i, j int) {
|
|
s[i], s[j] = s[j], s[i]
|
|
}
|
|
|
|
// Longer strings will appear first.
|
|
func (s ByLength) Less(i, j int) bool {
|
|
return len(s[i]) > len(s[j])
|
|
}
|