clipperhouse / gen

Type-driven code generation for Go
http://clipperhouse.com/gen/overview/
Other
1.43k stars 90 forks source link

Stable sort #109

Open aseemk opened 6 years ago

aseemk commented 6 years ago

Hi folks,

Great work on gen — it's very useful.

I'm unclear on whether Sort(By) is a stable sort or not. The code docs say the code is a modified version of https://golang.org/pkg/sort/#Sort — which is not stable. Is that still the case in this modified version? (Would be great to document this either way.)

If so, would it be possible to add stable versions of Sort and SortBy. The latter would be particularly helpful since the sort.Interface can't be code-gen'ed automatically for types that aren't naturally comparable.

Thanks!