在go中使用lua示例, 基于gopher-lua!
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

14 行
460 B

4年前
  1. local json = require("json")
  2. local jsonStringWithNull = [[{"a":{"b":1, "c":null}}]]
  3. local jsonString = [[{"a":{"b":1}}]]
  4. local result, err = json.decode(jsonStringWithNull)
  5. if err then error(err) end
  6. if not(result["a"]["b"] == 1) then error("must be decode") end
  7. print("done: json.decode()")
  8. local result, err = json.encode(result)
  9. if err then error(err) end
  10. if not(result==jsonString) then error("must be encode "..result) end
  11. print("done: json.encode()")