소스 검색

fix tests

Tao Wen 7 년 전
부모
커밋
002b5ae342
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      api_tests/decoder_test.go

+ 2 - 2
api_tests/decoder_test.go

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