|
|
@@ -216,7 +216,7 @@ func NewDecoder(r io.Reader) *Decoder
|
|
|
func NewEncoder(w io.Writer) *Encoder
|
|
|
```
|
|
|
|
|
|
-要想把 JSON 直接写入文件,可以使用 json.NewEncoder 初始化文件(或者任何实现 io.Writer 的类型),并调用 Encode();反过来与其对应的是使用 json.Decoder 和 Decode() 函数:
|
|
|
+要想把 JSON 直接写入文件,可以使用 json.NewEncoder 初始化文件(或者任何实现 io.Writer 的类型),并调用 Encode();反过来与其对应的是使用 json.NewDecoder 和 Decode() 函数:
|
|
|
|
|
|
```go
|
|
|
func NewDecoder(r io.Reader) *Decoder
|