1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-03 22:27:26 +02:00

use jsoniter for example

This commit is contained in:
zhaitianduo 2017-06-09 16:25:58 +08:00
parent 2608d40f2a
commit 46d443fbad

View File

@ -1,10 +1,10 @@
package jsoniter_test package jsoniter_test
import ( import (
"encoding/json"
"fmt" "fmt"
"github.com/json-iterator/go" "github.com/json-iterator/go"
"os" "os"
"encoding/json"
) )
func ExampleMarshal() { func ExampleMarshal() {
@ -37,7 +37,7 @@ func ExampleUnmarshal() {
Order string Order string
} }
var animals []Animal var animals []Animal
err := json.Unmarshal(jsonBlob, &animals) err := jsoniter.Unmarshal(jsonBlob, &animals)
if err != nil { if err != nil {
fmt.Println("error:", err) fmt.Println("error:", err)
} }