File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package test
2
2
3
3
import (
4
4
"bytes"
5
- "github.com /json-iterator/go "
5
+ "encoding /json"
6
6
"github.com/stretchr/testify/require"
7
7
"testing"
8
8
)
@@ -11,7 +11,7 @@ func Test_disallowUnknownFields(t *testing.T) {
11
11
should := require .New (t )
12
12
type TestObject struct {}
13
13
var obj TestObject
14
- decoder := jsoniter .NewDecoder (bytes .NewBufferString (`{"field1":100}` ))
14
+ decoder := json .NewDecoder (bytes .NewBufferString (`{"field1":100}` ))
15
15
decoder .DisallowUnknownFields ()
16
16
should .Error (decoder .Decode (& obj ))
17
17
}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ type frozenConfig struct {
13
13
indentionStep int
14
14
objectFieldMustBeSimpleString bool
15
15
onlyTaggedField bool
16
+ disallowUnknownFields bool
16
17
decoderCache sync.Map
17
18
encoderCache sync.Map
18
19
extensions []Extension
You can’t perform that action at this time.
0 commit comments