zonghaishang commented on a change in pull request #201:
URL: https://github.com/apache/dubbo-go-hessian2/pull/201#discussion_r437845170
##########
File path: object.go
##########
@@ -375,11 +374,18 @@ func (d *Decoder) decInstance(typ reflect.Type, cls
classInfo) (interface{}, err
for i := 0; i < len(cls.fieldNameList); i++ {
fieldName := cls.fieldNameList[i]
- index, fieldStruct, err := findFieldWithCache(fieldName, typ)
+ decodedValue, err := d.DecodeValue()
if err != nil {
return nil, perrors.Errorf("can not find field %s",
fieldName)
}
+ index, fieldStruct, err := findFieldWithCache(fieldName, typ)
+ if err != nil {
+ log.Printf("SKIP non-exist field:%s", fieldName)
Review comment:
1. 这里日志会被打爆哎? 可以控制下打印频率?比如type第一次出现才会输出
2. 另外这里decoder的行为是区分skip和非skip吗?如果是skip的decoder,
在decodeValue里面已经跳过了,是否还需要去findFieldWithCache一次 ??
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]