Skip to content

Instantly share code, notes, and snippets.

@obscuren
Created September 19, 2014 12:44
Show Gist options
  • Save obscuren/3a309953ca513cd5b1aa to your computer and use it in GitHub Desktop.
Save obscuren/3a309953ca513cd5b1aa to your computer and use it in GitHub Desktop.
// C CODE
#include "_cgo_export.h"
void ACFunction() {
printf("ACFunction()\n");
AGoFunction();
}
// GO Code
package gocallback
import "fmt"
/*
#include <stdio.h>
extern void ACFunction();
*/
import "C"
//export AGoFunction
func AGoFunction() {
fmt.Println("AGoFunction()")
}
func Example() {
C.ACFunction()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment