mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 06:36:43 +08:00
Update 12.9.md (#391)
This commit is contained in:
@@ -133,7 +133,7 @@ json 包使用 `map[string]interface{}` 和 `[]interface{}` 储存任意的 JSON
|
|||||||
来看这个 JSON 数据,被存储在变量 b 中:
|
来看这个 JSON 数据,被存储在变量 b 中:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
b == []byte({"Name": "Wednesday", "Age": 6, "Parents": ["Gomez", "Morticia"]})
|
b := []byte(`{"Name": "Wednesday", "Age": 6, "Parents": ["Gomez", "Morticia"]}`)
|
||||||
```
|
```
|
||||||
|
|
||||||
不用理解这个数据的结构,我们可以直接使用 Unmarshal 把这个数据编码并保存在接口值中:
|
不用理解这个数据的结构,我们可以直接使用 Unmarshal 把这个数据编码并保存在接口值中:
|
||||||
|
Reference in New Issue
Block a user