Skip to content

Instantly share code, notes, and snippets.

Created February 5, 2023 13:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bsiegert/eb94f435e7f3782ea0d53797fc1d82a8 to your computer and use it in GitHub Desktop.
Go and Lua Hello World
go 1.19
require v0.0.0-20221004153744-91867de107cf // indirect v0.0.0-20221004153744-91867de107cf h1:VSUCKpFV0AfYGslgQSRdBI9HCVp1TCXJmScWD0VXL5g= v0.0.0-20221004153744-91867de107cf/go.mod h1:UCCi6u6YA8oXfJ15vEMiMGIaWWfLiOacinBPHxLXtEU=
package main
import lua ""
func main() {
l := lua.NewState()
l.PushString("Hello World!\n")
l.Call(1, 0)
Copy link

Quick question, if I call DoString on the lua state, how can I retrieve the value of that lua code snippet? It seems the documentation is really lacking in go-lua.

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment