I have an old .so file with a very complex clang parser in it and I have to call it from a go module.
...
lib := C.dlopen(C.CString("./resources/bin/parser.so"), C.RTLD_LAZY)
functions_address := C.dlsym(lib, C.CString("parse"))
I have solved this by defining a C typedef, creating a helper method and passing the "functions_address" to that helper method which calls the other function by reference
typedef char (*parse) (char *file);
char bridge (parse p, char* file) {
p(file);
}