From 5772146858a91e91026ac77364dc02902c67a554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E4=BF=A1?= Date: Wed, 9 Dec 2020 10:32:23 +0800 Subject: [PATCH] fix: delete unsued comment --- encoding/json/parser.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/encoding/json/parser.go b/encoding/json/parser.go index 678808f..2447f21 100644 --- a/encoding/json/parser.go +++ b/encoding/json/parser.go @@ -98,17 +98,6 @@ func (jsp *jsonStructParser) cb(key []byte, value []byte, dataType jsonparser.Va jsp.subObjValueMap[string(key)] = reflect.ValueOf(subObj) case jsonparser.Array: // TODO slice parse - //newParser := newJSONStructParser() - //subObj := newParser.json2Struct(value) - //jsp.hessianRegisterPair = append(jsp.hessianRegisterPair, HessianRegisterPair{ - // JavaClassName: getJavaClassName(subObj), - // Obj: subObj, - //}) - //jsp.structFields = append(jsp.structFields, reflect.StructField{ - // Name: string(key), - // Type: reflect.TypeOf(subObj), - //}) - case jsonparser.String: // normal struct parse // "type@value" arr := strings.Split(string(value), "@") @@ -129,7 +118,8 @@ func (jsp *jsonStructParser) cb(key []byte, value []byte, dataType jsonparser.Va case "bool": userDefinedType = reflect.TypeOf(false) default: - log.Println("warning: val", string(value), " in json is not supported") + log.Printf("error: dataType %s in json is not supported\n", string(value)) + return perrors.Errorf("dataType %s in json is not supported", string(value)) } if len(arr) > 1 { jsp.valueMap[string(key)] = arr[1] @@ -139,7 +129,7 @@ func (jsp *jsonStructParser) cb(key []byte, value []byte, dataType jsonparser.Va Type: userDefinedType, }) default: - log.Printf("error: dataType %s in json is not supported", string(value)) + log.Printf("error: dataType %s in json is not supported\n", string(value)) return perrors.Errorf("dataType %s in json is not supported", string(value)) } return nil @@ -191,7 +181,7 @@ func (jsp *jsonStructParser) json2Struct(jsonData []byte) interface{} { v.Field(i).SetBool(true) } default: - log.Printf("error: val %s in value is not supported", valStr) + log.Printf("error: val %s in value is not supported\n", valStr) return perrors.Errorf("val %s in value is not supported", valStr) } }