I'm new to golang and I'd like to invert the order of appearance of pairs in a map like this so that the last pair comes first:
mapA := map[string]int {
"cat": 5,
"dog": 2,
"fish": 3 ,
}
fmt.Println(mapA)
map[cat:5 dog:2 fish:3]
The resulting map should be like:
map[fish:3 dog:2 cat:5]
It can be a new mapB with the same items but iverted order.
How can I achieve this?