|
|
|
|
|
by arnehormann
4429 days ago
|
|
It doesn't need to. You could also write
type Runes []rune
but the struct variant has the advantage that you can get the array back without any conversions - it's pretty cheap.
And you can embed it. That's an advantage if you e.g. don't define Less on Runes but define it on RunesAsc and RunesDesc.
See http://golang.org/pkg/sort/ -> Examples (SortWrapper) |
|