JSON

http://www.json.org/

JSON: JavaScript Object Notation.

json有两种数据结构.

key-value/键值对

1
2
3
4
5
{
    key: value,
    key1: value1,
    ...
}

列表/数组

1
[value, value1, ...]

数据类型

bool:

1
2
python -> True/False
go -> true/false

string:

1
2
3
python -> str
go -> string
go -> []byte -> base64编码字符串

number:

1
2
python -> int/float
go -> int64/float64

null:

1
2
python -> None
go -> nil

array

1
2
python -> tuple/list
go -> array/slice

object

1
2
python -> dict
go -> struct/map