You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, but it does not include related information regarding my question.
Yes, but the steps described do not work.
Yes, but I am having difficulty understanding it and want clarification.
Describe your question
I'm trying to convert a pure Go struct to a struct generated using protobuf that include oneof. The generated code for oneof create an un-exported interface ref with multiple struct that implement the interface. I didn't find a way to use goverter to convert such a field. I tried using a custom Mapping Method but since the type is not exported by protobuf, it's not possible to define such method. One workaround to work with oneof is to create a type alias in the same module as the generated code. However, goverter match type based on there name ref so an alias wouldn't work. Is there a way that I missed to convert a struct that contains such a oneof?
The text was updated successfully, but these errors were encountered:
Have you read the project readme?
Describe your question
I'm trying to convert a pure Go struct to a struct generated using protobuf that include
oneof
. The generated code foroneof
create an un-exported interface ref with multiple struct that implement the interface. I didn't find a way to use goverter to convert such a field. I tried using a custom Mapping Method but since the type is not exported by protobuf, it's not possible to define such method. One workaround to work withoneof
is to create a type alias in the same module as the generated code. However, goverter match type based on there name ref so an alias wouldn't work. Is there a way that I missed to convert a struct that contains such a oneof?The text was updated successfully, but these errors were encountered: