title: Creating Slice from Reflected Type
body: <p>I am trying to create a slice from a <code>reflect.Type</code>. This is what I have so far.</p>
  
  <pre class="lang-golang prettyprint-override"><code>package main
  
  import (
      "fmt"
      "reflect"
  )
  
  type TestStruct struct {
      TestStr string
  }
  
  func main() {
      elemType := reflect.TypeOf(TestStruct{})
  
      elemSlice := reflect.New(reflect.SliceOf(elemType)).Interface()
  
      elemSlice = append(elemSlice, TestStruct{"Testing"})
  
      fmt.Printf("%+v\n", elemSlice)
  
  }
  </code></pre>
  
  <p>However I get the following error and I'm not sure how to get around it without hardcoding a conversion to <code>[]TestStruct</code>.</p>
  
  <pre><code>prog.go:17: first argument to append must be slice; have interface {}
  </code></pre>
  
  <p>Is there anyway to treat the returned interface as a slice without having to hardcode the conversion from <code>interface{}</code> to <code>[]TestStruct</code>?</p>