How do I use Go's "foreign function interface" to call out to a C function?
This interface is mentioned on the FAQ, but I cannot see it mentioned elsewhere in the docs.
Paul Wicks
Check out this file from the Go repository. It shows how to wrap a C library in Go and has quite a few comments that explain the process.
来源:https://stackoverflow.com/questions/2740315/how-do-i-call-c-from-go-using-the-foreign-function-interface