How would you call foreign functions in C or C++ from Go? Is there something like a foreign function interface?
package rand
/*
#include <stdlib.h>
*/
import "C"
func Random() int {
return int(C.random())
}
func Seed(i int) {
C.srandom(C.uint(i))
}
So calling C functions from Go is very easy. However the other way is not supported, AFAIK.