We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi
I try to use goluago library, but I got the error:
runtime error: scripts/gointeroperate.lua:3: attempt to index trim 'local' (a nil value)
The lua script is:
require("goluago/strings") strings.trim("loll ")
Invoking the script like this:
package main import ( "gitlab.meitu.com/pl_storage/atlas/atlas-devops/data" "github.com/Shopify/go-lua" "github.com/Shopify/goluago" "fmt" ) type LuaProcessor struct { L *lua.State Script string } // script: the lua script file name func NewLuaProcessor(script string) *LuaProcessor { l := lua.NewState() lua.OpenLibraries(l) goluago.Open(l) return &LuaProcessor{L:l, Script:script} } func (processor *LuaProcessor) Process(taskIndex int, record data.Record) (size int32, err error) { if err := lua.DoFile(processor.L, processor.Script); err != nil { fmt.Print(err) } return 0, nil } func ExampleLuaProcessor_GoInteroperate() { processor := NewLuaProcessor("scripts/gointeroperate.lua") processor.Process(1, nil) //Output:Hello World from Lua file! }
Any helps? thanks.
The text was updated successfully, but these errors were encountered:
I have tried on go 1.5 and 1.4.2, both don't work.
Sorry, something went wrong.
No branches or pull requests
Hi
I try to use goluago library, but I got the error:
The lua script is:
Invoking the script like this:
Any helps? thanks.
The text was updated successfully, but these errors were encountered: