Skip to content

Commit d1cb61e

Browse files
authored
Merge pull request #497 from warjiang/fix/typo-error
fix: return value error for CompileLua example
2 parents 7f73012 + ec73447 commit d1cb61e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,10 @@ Sharing byte code is safe as it is read only and cannot be altered by lua script
595595
596596
// Example shows how to share the compiled byte code from a lua script between multiple VMs.
597597
func Example() {
598-
codeToShare := CompileLua("mylua.lua")
598+
codeToShare, err := CompileLua("mylua.lua")
599+
if err != nil {
600+
panic(err)
601+
}
599602
a := lua.NewState()
600603
b := lua.NewState()
601604
c := lua.NewState()

0 commit comments

Comments
 (0)