title: Convert struct to []json.RawMessage
body: <p>Trying to convert a struct to []json.RawMessage. My understanding is that json.Marshal() converts it to byte[] as is []json.RawMessage. I cannot however seem to convert between the two. My function expects to receive input as <code>[]json.RawMessage</code>.</p>
  
  <p>Have tried several different methods including <code>myIn := json.RawMessage(&amp;myJsonStruct{"string1", "string2"})</code> and <code>myIn := (*json.RawMessage)(json.Marshal(&amp;myJsonStruct{"string1", "string2"}))</code></p>
  
  <pre><code>type myJsonStruct struct {
      myString       string  `json:"myString"`
      mySecongString string  `json:"mySecondString"`
  }
  
  myIn := json.Marshal(&amp;myJsonStruct{"string1", "string2"})
  
  myFunction(myIn)
  
  myFunction(receivedIn []json.RawMessage) {
      //do work
      return
  }
  </code></pre>