1
0
mirror of https://github.com/json-iterator/go.git synced 2025-03-29 21:20:52 +02:00

fix build

This commit is contained in:
Tao Wen 2018-02-05 23:05:57 +08:00
parent 71f74dc71e
commit 07f99a1124
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@ package test
import (
"bytes"
"github.com/json-iterator/go"
"encoding/json"
"github.com/stretchr/testify/require"
"testing"
)
@ -11,7 +11,7 @@ func Test_disallowUnknownFields(t *testing.T) {
should := require.New(t)
type TestObject struct{}
var obj TestObject
decoder := jsoniter.NewDecoder(bytes.NewBufferString(`{"field1":100}`))
decoder := json.NewDecoder(bytes.NewBufferString(`{"field1":100}`))
decoder.DisallowUnknownFields()
should.Error(decoder.Decode(&obj))
}

View File

@ -13,6 +13,7 @@ type frozenConfig struct {
indentionStep int
objectFieldMustBeSimpleString bool
onlyTaggedField bool
disallowUnknownFields bool
decoderCache sync.Map
encoderCache sync.Map
extensions []Extension