Go <=> Deno
MIT License
Write your Go -
// go_deno.go
import "C"
//export gofunc
func gofunc(arg string) {
// do stuff here...
}
func main() {}
...build as a c-shared library
go build -buildmode=c-shared -o mygolib.so
...and load and call it from Deno
// go_deno.ts
import { GoDeno } from "./mod.ts";
let plugin = new GoDeno("./mygolib.so");
plugin.dispatch("gofunc", "JS arg");
cd example/
go build -buildmode=c-shared -o hello.so
deno run -A --unstable ./hello.ts
MIT License. Contributions welcome.