Label: perfomance
03 Mar 2017
String transfer from a function in GO to a code on C without memory allocation (Part 1)
![](https://sp-ao.shortpixel.ai/client/to_auto,q_glossy,ret_img,w_150,h_150/https://tips.efmsoft.com/wp-content/uploads/2017/02/Running-512-150x150.png)
CGO documentation illuminates string transfer issue rather poorly. They only mention that C.CString() function should be used in order to convert a string object into a pointer to a buffer with a zero-terminated string – char*, which is coherent for the C code. This is great; however, a memory block is being allocated during this procedure