title: How do I copy a Go string to a C char * via CGO in golang?
body: <p>I want to copy a Go string into a char * via CGO.</p>
  
  <p>Am I allowed to do this something like this?</p>
  
  <pre><code>func copy_string(cstr *C.char) {
  
      str := "foo"
      C.GoString(cstr) = str
  
  }
  </code></pre>