Python module written in Golang and C
<p>I follow this <a href="https://blog.filippo.io/building-python-modules-with-go-1-5/" rel="nofollow">tutorial</a> </p>

<p>to write this code, in C:</p>

<pre><code>#define Py_LIMITED_API
#include &lt;Python.h&gt;

PyObject * startVM(PyObject *, PyObject *);

int PyArg_ParseTuple_S(PyObject * args, char* a) {  
    return PyArg_ParseTuple(args, "s", &amp;a);
}

static PyMethodDef FooMethods[] = {  
    {"startVM", startVM, METH_VARARGS, "Starts."},
    {NULL, NULL, 0, NULL}
};

static struct PyModuleDef foomodule = {  
   PyModuleDef_HEAD_INIT, "foo", NULL, -1, FooMethods
};

PyMODINIT_FUNC PyInit_foo(void) {
    return PyModule_Create(&amp;foomodule);
}
</code></pre>

<p>and this code in GO:</p>

<pre><code>package main

import "fmt"


// #cgo pkg-config: python3
// #define Py_LIMITED_API
// #include &lt;Python.h&gt;
// int PyArg_ParseTuple_S(PyObject *,char *);
import "C"

//export startVM
func startVM(self, args *C.PyObject) {  
    var a *C.char
    if C.PyArg_ParseTuple_S(args, a) == 0 {
        //return nil
    }
    fmt.Println(a)
    //return C.PyBytes_FromString(&amp;a)
}

func main() {}  
</code></pre>

<p>I can compile the code in go, but when I call in python the module with this command: <code>python3 -c 'import foo; foo.startVM("hello")'</code>, it prints nil and results in segmentation fault...
Could someone know how to fix it?
Thanks in advance.</p>