2 ms·
Just thought of one more way to do this which is neater - define functions on a simpler slice type: https://play.golang.org/p/0YcxA-Ufs- https://play.golang.o
by grey-area 10y ago
Just thought of one more way to do this which is neater - define functions on a simpler slice type:
https://play.golang.org/p/0YcxA-Ufs- https://play.golang.org/p/0YcxA-Ufs-
So your sorting becomes quite neat:
sort.SliceStable(changes,changes.byLines)
sort.SliceStable(changes,changes.byUser)
I think I might use it this way (haven't actually used this in a real app yet).
- SaidinWoT 10y agoPerhaps something combining all of the things you've made use of? https://play.golang.org/p/8RDqjjZDB8 https://play.golang.org/p/8RDqjjZDB8