Let’s say that I have two different C methods
// My C methods:
MyFirstMethod(const char *str)
MySecondMethod(const char * const str)
I know that I can use this code to pass my variable to the first method
var strPtr *C.char
strPtr = C.CString("My String Here")
defer C.free(unsafe.Pointer(strPtr))
res := C.MyFirstMethod(strPtr)
However, I am not sure for the second one, is there any difference? Should I use the same code? I know that there are not the same type and I am not sure if I should use something else to pass my argument to the second method.
Here is a topic that explains the difference between const char * and const char * const