Inclure du C dans Go lang

Voir :

https://go.dev/wiki/cgo

https://github.com/lxwagn/using-go-with-c-libraries

package main // #include <stdio.h> // #include <stdlib.h> // // static void myprint(char* s) { // printf("%s\n", s); // } import "C" import "unsafe" func main() { cs := C.CString("Hello from stdio") C.myprint(cs) C.free(unsafe.Pointer(cs)) }

Source : https://pkg.go.dev/cmd/cgo