Skip to content

Commit

Permalink
fix: lua encode structural error (#385)
Browse files Browse the repository at this point in the history
Signed-off-by: FlyFishking <[email protected]>
  • Loading branch information
FlyFishking authored Dec 25, 2024
1 parent ca4d9e6 commit 6a88430
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/module/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"encoding/json"
"errors"

"github.com/yuin/gopher-lua"
lua "github.com/yuin/gopher-lua"
)

// Preload adds json to the given Lua state's package.preload table. After it
Expand Down Expand Up @@ -117,7 +117,7 @@ func (j jsonValue) MarshalJSON() (data []byte, err error) {

switch key.Type() {
case lua.LTNil: // empty table
data = []byte(`[]`)
data = []byte(`null`)
case lua.LTNumber:
arr := make([]jsonValue, 0, converted.Len())
expectedKey := lua.LNumber(1)
Expand Down

0 comments on commit 6a88430

Please sign in to comment.