3 ms·
Go's method is like that because it didn't have generics, but it does have the advantage of allowing you to sort more complicated things, e.g. indexes into othe
by IshKebab 4y ago
Go's method is like that because it didn't have generics, but it does have the advantage of allowing you to sort more complicated things, e.g. indexes into other data structures, or computed values.
Sorting by key is a special case (admittedly the most common special case).