How to get a slice of values from a map in Go?
Hi everyone! I recently started learning Go and encountered this task: I have a map where keys are strings and values are integers. I need to get all the values from this map as a slice, so that I can, for example, pass them to a function for processing or just display them on the screen.
Here's an example of my code:
```go
package main
import "fmt"
func main() {
scores := map[string]int{
"Alice": 95,
"Bob": 87,
"Charlie": 92,
}
// How to get a slice of values?
// I want something like: values := scores.values()
// But there is no such method...
fmt.Println("All scores:", ???)
}
```
I tried looking in the documentation, but I only found how to get keys using `range`. What about values? I need the result to be