mirror of
https://github.com/go-kratos/kratos.git
synced 2026-05-22 10:15:24 +02:00
fix: fix encode form well known message bug (#1568)
fix: fix encode form well known message bug
This commit is contained in:
@@ -158,10 +158,10 @@ func encodeMessage(msgDescriptor protoreflect.MessageDescriptor, value protorefl
|
|||||||
case "google.protobuf.DoubleValue", "google.protobuf.FloatValue", "google.protobuf.Int64Value", "google.protobuf.Int32Value",
|
case "google.protobuf.DoubleValue", "google.protobuf.FloatValue", "google.protobuf.Int64Value", "google.protobuf.Int32Value",
|
||||||
"google.protobuf.UInt64Value", "google.protobuf.UInt32Value", "google.protobuf.BoolValue", "google.protobuf.StringValue":
|
"google.protobuf.UInt64Value", "google.protobuf.UInt32Value", "google.protobuf.BoolValue", "google.protobuf.StringValue":
|
||||||
fd := msgDescriptor.Fields()
|
fd := msgDescriptor.Fields()
|
||||||
v := value.Message().Get(fd.ByName(protoreflect.Name("value"))).Message()
|
v := value.Message().Get(fd.ByName(protoreflect.Name("value")))
|
||||||
return fmt.Sprintf("%v", v.Interface()), nil
|
return fmt.Sprintf("%v", v.Interface()), nil
|
||||||
case "google.protobuf.FieldMask":
|
case "google.protobuf.FieldMask":
|
||||||
m, ok := value.Interface().(*field_mask.FieldMask)
|
m, ok := value.Message().Interface().(*field_mask.FieldMask)
|
||||||
if !ok {
|
if !ok {
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user