duke-git/lancet

Maputil.MapTo方法有误

Closed this issue · 2 comments

执行方法Maputil.MapTo,当dst指向的对象内嵌对象为指针时会报错。比如:
type MerchantModelMsg struct {
Id string json:"_id"
InsertTime int64 json:"insert_time"
UpdateTime int64 json:"update_time"
DeleteTime int64 json:"delete_time"
LastVersion int64 json:"last_version"
DataVersion int64 json:"data_version"
Data *MerchantModelMsg_Data json:"data" //此处会报错,如果为MerchantModelMsg_Data类型则不会。
}

type MerchantModelMsg_Data struct {
CreditCode string json:"credit_code"
CreditName string json:"credit_name"
}

//grpc生成的代码一般都是指针类型,请大佬修复一下,谢谢

@az2az ok,下个版本(v2.2.10)会修复。

v2.3.0版本已修复