Skip to content

Instantly share code, notes, and snippets.

@surma
Created March 12, 2013 12:56
Show Gist options
  • Save surma/5142664 to your computer and use it in GitHub Desktop.
Save surma/5142664 to your computer and use it in GitHub Desktop.
go-v8 test
package main
import (
"log"
v8 "github.com/voxelbrain/go-v8"
)
func main() {
ctx := v8.NewContext()
ctx.AddFunc("print", func(v ...interface{}) interface{} {
log.Printf("%#v", v)
return nil
})
ctx.Eval(`
var a = 0;
a += 9;
a = a*a;
print(parseInt(a));
`)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment