I have an array/slice of members:
type Member struct {
Id int
LastName string
FirstName string
}
var members []Member
My quest
All good answers, If you don't want to write any configuration. You can use the external package to perform sorting.
go get -d github.com/raunakjodhawat/multisort
And call the function like so:
sortedSlice, err := multisort.MultiSorted(inputSlice, inputKeys, SortOrders)
To look at a concrete example, go to: https://github.com/raunakjodhawat/multisort