Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to convert to code generate by protobuf oneof #54

Closed
1 of 3 tasks
gpoulin opened this issue Feb 10, 2023 · 1 comment
Closed
1 of 3 tasks

Is there a way to convert to code generate by protobuf oneof #54

gpoulin opened this issue Feb 10, 2023 · 1 comment
Labels
question Further information is requested

Comments

@gpoulin
Copy link

gpoulin commented Feb 10, 2023

Have you read the project readme?

  • 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?

@gpoulin gpoulin added the question Further information is requested label Feb 10, 2023
@jmattheis
Copy link
Owner

Could you provide a minimal example which goverter cannot convert (input, output struct & goverter converter interface)?

@jmattheis jmattheis closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants