binder icon indicating copy to clipboard operation
binder copied to clipboard

Panic with String field in module

Open LGMAM opened this issue 2 years ago • 1 comments

Hi,

This code is throwing a panic error and can't figure what the problem is:

	b := binder.New()
	m := b.Module("request")
	m.String("host", "foo")
	b.DoString(`
	local r=require 'request'
	print(r.host)
	`)

panic({0x94ef40, 0xe38c70}) /usr/lib/go-1.18/src/runtime/panic.go:844 +0x258 github.com/yuin/gopher-lua.(*LState).PCall(0xc0000cf3f0, 0x0, 0xc0002bad40?, 0x0) /home/luis/go/pkg/mod/github.com/yuin/[email protected]/state.go:1972 +0x68 github.com/yuin/gopher-lua.(*LState).DoString(0xc0000cf3f0, {0x9f8d4d?, 0x110?}) /home/luis/go/pkg/mod/github.com/yuin/[email protected]/auxlib.go:405 +0x6b github.com/alexeyco/binder.(*Binder).DoString(0xc0002be0c0, {0x9f8d4d, 0x1d}) /home/luis/go/pkg/mod/github.com/alexeyco/[email protected]/binder.go:26 +0x139 main.(*application).luaHandler(0xe52e40?, {0xb33470, 0xc0001aa1c0}, 0x20?) /home/luis/noname-backend/cmd/api/lua.go:26 +0x2b0

Using

go 1.18.1
github.com/alexeyco/binder v0.0.0-20180729220023-2a21303f588a

Any hint ?

Thanks, Luis

LGMAM avatar Sep 12 '23 11:09 LGMAM