Skip to content

Commit

Permalink
fix: use .MapKey to get key's FieldDescriptor (#3196)
Browse files Browse the repository at this point in the history
Co-authored-by: 欧阳凯 <[email protected]>
  • Loading branch information
oyk666 and 欧阳凯 authored Mar 11, 2024
1 parent 50cad79 commit f566bdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion encoding/form/proto_encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func encodeRepeatedField(fieldDescriptor protoreflect.FieldDescriptor, list prot
func encodeMapField(fieldDescriptor protoreflect.FieldDescriptor, mp protoreflect.Map) (map[string]string, error) {
m := make(map[string]string)
mp.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool {
key, err := EncodeField(fieldDescriptor.MapValue(), k.Value())
key, err := EncodeField(fieldDescriptor.MapKey(), k.Value())
if err != nil {
return false
}
Expand Down

0 comments on commit f566bdc

Please sign in to comment.