在go中使用lua示例, 基于gopher-lua!
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

385 B

json

origin code: https://github.com/vadv/gopher-lua-libs/tree/master/json

Usage

local json = require("json")

-- json.encode()
local jsonString = [[
    {
        "a": {"b":1}
    }
]]
local result, err = json.decode(jsonString)
if err then error(err) end

-- json.decode()
local table = {a={b=1}}
local result, err = json.encode(table)
if err then error(err) end