I have the requirement constraint for my work, due to which I need to use a C++ function as:
bool f1(const char* str)
{
//.....
}
The function argument needs to be type const char*
However, when I try something like following in the golang source code:
//export f1
func f1(str const *C.char) C.bool {
//.......
}
On doing go build, I get the error:
expected type, found 'const'
I tried replacing
func f1(str const *C.char)
by
func f1(str const *C.GoString)
This time, I got the error:
expression C.GoString used as type
I am clueless about how to do so.