Top "Cgo" questions

Cgo enables the creation of Go packages that call C code.

How do I copy a Go string to a C char * via CGO in golang?

I want to copy a Go string into a char * via CGO. Am I allowed to do this something like …

go cgo
Go/CGo - how do you use a C array passed as a pointer

I'm posting this as a question/answer, as it took me a while to work out, and I wouldn't mind …

go cgo
Compile cgo lib on Cygwin64: "ld: cannot find -lmingw32"

I'm trying to use a cgo library on Windows, namely github.com/mattn/go-sqlite3 I use Cygwin64 and installed with …

gcc go sqlite cygwin cgo
Calling Go from Python

I tried to run a simple in a go script from python and I got a segmentation fault. Here is …

python python-3.x go cgo
Can I use c++ in cgo?

Is it possible to mix in some C++ code in cgo? I tried this: package main /* #include <iostream> …

c++ go cgo
CGO, how to pass NULL parameter to C function

Sometimes, a NULL pointer may be needed for a C API. is that possible in CGO? For example, I want …

go null-pointer cgo
Golang - C source files not allowed when not using cgo

When trying to run go build in my src directory, I get this error: imports runtime: C source files not …

linux ubuntu go cgo