Skip to content

Commit cf064eb

Browse files
committed
remove string kind convert
1 parent c71796e commit cf064eb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

encoding/form/proto_encode.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,12 @@ func EncodeField(fieldDescriptor protoreflect.FieldDescriptor, value protoreflec
137137
}
138138
desc := fieldDescriptor.Enum().Values().ByNumber(value.Enum())
139139
return string(desc.Name()), nil
140-
case protoreflect.StringKind:
141-
return value.String(), nil
142140
case protoreflect.BytesKind:
143141
return base64.URLEncoding.EncodeToString(value.Bytes()), nil
144142
case protoreflect.MessageKind, protoreflect.GroupKind:
145143
return encodeMessage(fieldDescriptor.Message(), value)
146144
default:
147-
return fmt.Sprint(value.Interface()), nil
145+
return value.String(), nil
148146
}
149147
}
150148

0 commit comments

Comments
 (0)