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)
arnehormann|12 years ago
dvisher|12 years ago
The real cost of this is definitely the verbosity for something that could be much simpler.
azth|12 years ago