在go中使用lua示例, 基于gopher-lua!
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

21 satır
301 B

package json
import (
lua "github.com/yuin/gopher-lua"
)
func PreloadGo(L *lua.LState) {
L.PreloadModule("json", Loader)
}
func Loader(L *lua.LState) int {
t := L.NewTable()
L.SetFuncs(t, api)
L.Push(t)
return 1
}
var api = map[string]lua.LGFunction{
"decode": Decode,
"encode": Encode,
}