fangyincheng commented on a change in pull request #201:
URL: https://github.com/apache/dubbo-go-hessian2/pull/201#discussion_r437863418
##########
File path: codec.go
##########
@@ -422,6 +420,59 @@ func SetSlice(dest reflect.Value, objects interface{})
error {
return nil
}
+// SetMap set value(map[interface{}]interface{}) into map[T]T
+func SetMap(dest reflect.Value, objects interface{}) error {
+ if objects == nil {
+ return nil
+ }
+
+ src := objects.(map[interface{}]interface{})
+ srcv := reflect.ValueOf(src)
+
+ dest = UnpackPtrValue(dest)
+ destTyp := UnpackPtrType(dest.Type())
+ if dest.IsNil() {
+ dest.Set(reflect.MakeMap(destTyp))
+ }
+ for _, keyv := range srcv.MapKeys() {
+ dest.SetMapIndex(reflect.ValueOf(keyv.Interface()),
reflect.ValueOf(srcv.MapIndex(keyv).Interface()))
+ }
+
+ return nil
Review comment:
同上
##########
File path: object.go
##########
@@ -398,11 +398,18 @@ func (d *Decoder) decInstance(typ reflect.Type, cls
classInfo) (interface{}, err
// get field type from type object, not do that from value
fldTyp := UnpackPtrType(field.Type())
+ fldTypName := fldTyp.String()
+ log.Println(fldTypName)
Review comment:
同上
----------------------------------------------------------------
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]