From 07f99a112488b31a8b48cef082e81f72889f3570 Mon Sep 17 00:00:00 2001 From: Tao Wen Date: Mon, 5 Feb 2018 23:05:57 +0800 Subject: [PATCH] fix build --- api_tests/decoder_test.go | 4 ++-- feature_config_with_sync_map.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api_tests/decoder_test.go b/api_tests/decoder_test.go index 8213393..12ed82a 100644 --- a/api_tests/decoder_test.go +++ b/api_tests/decoder_test.go @@ -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)) } diff --git a/feature_config_with_sync_map.go b/feature_config_with_sync_map.go index 360117f..02dfaee 100644 --- a/feature_config_with_sync_map.go +++ b/feature_config_with_sync_map.go @@ -13,6 +13,7 @@ type frozenConfig struct { indentionStep int objectFieldMustBeSimpleString bool onlyTaggedField bool + disallowUnknownFields bool decoderCache sync.Map encoderCache sync.Map extensions []Extension