Skip to content

alexjx/gopher-lua-libs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/alexjx/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 get github.com/alexjx/gopher-lua-libs/cmd/glua-libs

$ 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/alexjx/gopher-lua-libs"

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


func main() {
        flag.Parse()
        state := lua.NewState()
        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)
        }
}

About

Libs for gopher lua

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 84.3%
  • Lua 15.5%
  • Other 0.2%