This question already has an answer here:
Say I have the following map:
d := map[string]int{
"a": 1,
"b": 2,
"c": 3,
}
How can I get the values in the map as a slice? eg. [1,2,3]
</div>
m := make([]int, 0, len(d))
for _, val := range d {
m = append(m, val)
}
Note: the order of the slice is not deterministic; you may have to reorder it, depending on your use case.