Top "Cgo" questions

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

exec: "gcc": executable file not found in %PATH% when trying go build

I am using Windows 10. When I tried to build Chaincode it reported this error # github.com/hyperledger/fabric/vendor/github.…

windows go build hyperledger-fabric cgo
How do you statically link a c library in go using cgo?

So there's a bunch of stuff on the group that suggests you can do this in go (although not on …

go cgo
Why is compiling with CGO_ENABLED=0 slower?

When writing programs which utilize network, you can see quite noticeable slowdown of compilation with CGO_ENABLED=0. For example, the …

go compilation cgo
Convert Go []byte to a C *char

I have a byte.Buffer that I pack with data using the binary.Write() function. I then need to send …

go cgo
Is it possible to use environment variables in a cgo CFLAGS comment?

I'm attempting to write some C bindings for the Go language, and have run into a sort of sticky situation …

linker go cgo
How to use a relative path for LDFLAGS in golang

I am trying to build a golang program which uses a static lib (.a file) the directory struct for my …

go path relative-path cgo ldflags
Cgo: sorry, unimplemented: 64-bit mode not compiled in

I'm currently trying to add some C code to my Go project. nothing fancy /* #include <stdio.h> void …

go cgo
Pass struct and array of structs to C function from Go

Stuck with this problem. Able to get only the first member of passed structure... What I do wrong? And what …

go cgo
Why cgo's performance is so slow? is there something wrong with my testing code?

I'm doing a test: compare excecution times of cgo and pure Go functions run 100 million times each. The cgo function …

c performance go cgo
passing function pointer to the C code using cgo

Starting from Go v1.6 cgo changed the rules of passing pointers to the C code golang/go#12416. The example of …

go cgo