In general, you can not pass a func value to C.
That said, it is fine to pass an exported function (with a `//export
NAME` comment) to C. And it is of course fine to pass a C function
pointer to C (accessing the C function as `C.CNAME`) and that C
function pointer can do whatever it likes, including calling a Go
function.
It is also fine to store a func value in a map, and pass the map index
to C, have the C function call a known Go function, and have that Go
function look up the index in the map and call the function. You can
see a simple version of this in the Go source code in
misc/cgo/test/callback.go.
Ian