title: In Go how to get a slice of values from a map?
body: <p>If I have a map <code>m</code> is there a better way of getting a slice of the values <code>v</code> than this?</p>
  <pre><code>package main
  import (
    &quot;fmt&quot;
  )
  
  func main() {
      m := make(map[int]string)
  
      m[1] = &quot;a&quot;
      m[2] = &quot;b&quot;
      m[3] = &quot;c&quot;
      m[4] = &quot;d&quot;
  
      // Can this be done better?
      v := make([]string, len(m), len(m))
      idx := 0
      for  _, value := range m {
         v[idx] = value
         idx++
      }
  
      fmt.Println(v)
   }
  </code></pre>
  <p>Is there a built-in feature of a <code>map</code>? Is there a function in a Go package, or is this the only way to do this?</p>