Seems a basic question, but can't find a simple answer.
I have a slice:
[]string{"dog", "cat", "bird"}
What's the best way to sort it by looking up the sorting values in a map:
map[string]int{"dog": 2, "cat":3, "bird": 1}
So that the slice is ordered as below:
[]string{"bird", "dog", "cat"}