deno/main.go
Ryan Dahl f7c5e19081 Init
2018-05-13 23:32:01 -04:00

32 lines
551 B
Go

// To test: make && ./out/render test_input.js
package main
//go:generate go-bindata -pkg $GOPACKAGE -o assets.go dist/
import (
"github.com/ry/v8worker2"
)
func recv(msg []byte) []byte {
println("recv cb", string(msg))
return nil
}
func main() {
indexFn := "dist/main.js"
data, err := Asset(indexFn)
if err != nil {
panic("asset not found")
}
code := string(data)
worker := v8worker2.New(recv)
// Load up index.js code.
err = worker.Load(indexFn, code)
if err != nil {
println("Problem executing Javascript.")
panic(err)
}
}