title: Golang copy elements of object to slice
body: <p>Is there any better way to apply a function to fields of an object and then copy the result to a new slice? By better I mean having a better performance than a for loop.</p>
  
  <pre><code>var tmp []string
  for _, value := range some_object.some_field {
      tmp = append(tmp, do_something(value))
  }
  </code></pre>
  
  <p>Something like:</p>
  
  <pre><code>tmp := map_copy(do_something(some_object.some_field))
  </code></pre>
  
  <p>With the resulting slice being:</p>
  
  <pre><code>tmp[0] = do_something(some_object.some_value[0])
  tmp[1] = do_something(some_object.some_value[1])
  tmp[2] = do_something(some_object.some_value[2])
  ....
  </code></pre>