Files
llgo/c/lua/_demo/hello/hello.go

22 lines
295 B
Go
Raw Normal View History

2024-06-27 18:19:45 +08:00
package main
import (
_ "unsafe"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/lua"
)
func main() {
2024-07-13 22:57:01 +08:00
L := lua.Newstate()
2024-06-27 18:19:45 +08:00
defer L.Close()
2024-07-13 22:57:01 +08:00
L.Openlibs()
if res := L.Dostring(c.Str("print('hello world')")); res != lua.OK {
2024-06-27 18:19:45 +08:00
println("error")
}
}
2024-07-13 22:57:01 +08:00
/* Expected output:
hello world
*/