You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-30 23:23:49 +02:00
Merge pull request #49 from zhaitianduo/master
Use jsoniter instead of json in example
This commit is contained in:
@ -2,9 +2,9 @@ package jsoniter_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/json-iterator/go"
|
|
||||||
"os"
|
"os"
|
||||||
"encoding/json"
|
|
||||||
|
"github.com/json-iterator/go"
|
||||||
)
|
)
|
||||||
|
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user