在go中使用lua示例, 基于gopher-lua!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 rivejä
385 B

4 vuotta sitten
  1. # json
  2. origin code: https://github.com/vadv/gopher-lua-libs/tree/master/json
  3. ## Usage
  4. ```lua
  5. local json = require("json")
  6. -- json.encode()
  7. local jsonString = [[
  8. {
  9. "a": {"b":1}
  10. }
  11. ]]
  12. local result, err = json.decode(jsonString)
  13. if err then error(err) end
  14. -- json.decode()
  15. local table = {a={b=1}}
  16. local result, err = json.encode(table)
  17. if err then error(err) end
  18. ```