Gopher Lua Libs Save

Libs for gopher lua

Project README

gopher-lua-libs

GoDoc

Package contains is a libs for gopher-lua.

License

Development version, available on github, released under BSD 3-clause.

Installation

go get github.com/vadv/gopher-lua-libs

Index

Usage

For the quick overview you can use standalone interpreter with listed libs. Examples and documentation for modules can be found in their directories.

go install github.com/vadv/gopher-lua-libs/cmd/glua-libs@latest

glua-libs example.lua

This example shows basic usage of this libs in your code

package main


import (
        "log"
        "flag"
        "os"

        lua "github.com/yuin/gopher-lua"
        libs "github.com/vadv/gopher-lua-libs"

)
var (
        exec = flag.String("execute", "", "execute lua script")
)


func main() {
        flag.Parse()
        state := lua.NewState()
        defer state.Close()
        libs.Preload(state)
        if *exec != `` {
                if err := state.DoFile(*exec); err != nil {
                        log.Printf("[ERROR] Error executing file: ", err)
                }
        } else {
                log.Println("Target file was not given!")
                os.Exit(0)
        }
}


Open Source Agenda is not affiliated with "Gopher Lua Libs" Project. README Source: vadv/gopher-lua-libs
Stars
140
Open Issues
4
Last Commit
3 months ago
License

Open Source Agenda Badge

Open Source Agenda Rating