A Go(lang) wrapper for LuaJit-2.x(Lua JIT Library) which is often used for embed script support. Forked from [RyouZhang] (https://github.com/RyouZhang/go-lua)
To use the library you need LuaJit 2.0/2.1 installed.
package main
import (
"fmt"
"github.com/kjx98/cgo-lua"
)
func main() {
res, err := lua.Call("script.lua", "test_args", 69)
if err != nil {
fmt.Println("test_args", err)
} else {
fmt.Println(res)
}
}
Install the dependencies then run
$ go install github.com/kjx98/cgo-lua
To use luajit for go, you need to have the Luajit-2.x already installed:
$ brew install luajit
Install from your package manager or install from source.
On Debian/Ubuntu/Fedora Linux luajit-2.1
is available from the distro.
To compile first download Luajit-2.1 and:
$ untar and cd
$ make
$ sudo make install
Copyright (c) 2018 Jesse Kuang