title: Pass a generic struct/interface into a function and return it
body: <p>Can I pass a generic struct or interface into a function, and then return it?  I've tried using pointers in the example below, and I've also tried using struct as a return type but I can't seem to do it.</p>
  
  <p>If I use interface{} instead, I seem to be able to pass postData in but getting it back seems to be impossible by returning or updating a pointer.  Can anyone tell me where I'm going wrong?</p>
  
  <pre><code>func EmailHandler(writer http.ResponseWriter, request *http.Request) {
      var postData = EmailPostData{}
      ConvertRequestJsonToJson(request, &amp;postData)
  }
  
  func ConvertRequestJsonToJson(request *http.Request, model *struct{}) {
      postContent, _ := ioutil.ReadAll(request.Body)
      json.Unmarshal([]byte(postContent), &amp;model)
  }
  </code></pre>