You can call C from Go and Go from C, but only within the framework of a Go program.
So your example of a C program with a main()
won't work, because that would be calling Go from within the framework of a C program.
In other words, Go can't make objects you can link statically or dynamically with C programs.
So you'll have to turn what you want to do on its head and make the Go program the master, and call the C program parts from it. That means the program with the main()
function must be a Go program.
Hope that makes sense!