You are coming from Java.
Nope. Clojure and Haskell. Clojure:
user=> (sort > (vals {:foo 5, :bar 2, :baz 10}))
(10 5 2)
Haskell: >>> sortBy (flip compare) . map snd $ [("foo", 5), ("bar", 2), ("baz", 10)]
[10,5,2]
In any case, there is a more elegant solution in Go, which is simply:
You need to open your mind a little bit, to learn a new language.