Is there a way to convert the go class to protobuf?

19 views
Skip to first unread message

Srinivasa Rao Chirathanagandla

unread,
Aug 21, 2019, 6:38:34 PM8/21/19
to Protocol Buffers
Hi,

Is there a way to convert the go class to protobuf? I want to convert the following to .proto file.


Thanks in advance.

Regards,
Srinivas

Alex Van Boxel

unread,
Aug 22, 2019, 3:22:33 AM8/22/19
to Srinivasa Rao Chirathanagandla, Protocol Buffers
I don't think that tooling exists todo this, but even if it did I would strongly advice against it. I've worked in a project where proto's where created for C# classes and keeping the proto's compatible with each change of the C# classes was a nightmare.

The great thing of working with proto's as a source for your code (be it go or something else) is that you change your thinking pattern. It makes you think about your contract, it's easy to keep compatible because you know and see what you are doing with your messages.

 _/
_/ Alex Van Boxel


--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/1e95a6c8-629e-41cf-9265-7b0c7f310c2f%40googlegroups.com.

Srinivasa Rao Chirathanagandla

unread,
Aug 22, 2019, 3:02:17 PM8/22/19
to Protocol Buffers
Hi Alex, 

Thank you for the reply. Yes, I agree with you on designing the protos first and using it in different languages. I will work in that direction.

Regards,
Srinivas


On Thursday, August 22, 2019 at 12:22:33 AM UTC-7, Alex Van Boxel wrote:
I don't think that tooling exists todo this, but even if it did I would strongly advice against it. I've worked in a project where proto's where created for C# classes and keeping the proto's compatible with each change of the C# classes was a nightmare.

The great thing of working with proto's as a source for your code (be it go or something else) is that you change your thinking pattern. It makes you think about your contract, it's easy to keep compatible because you know and see what you are doing with your messages.

 _/
_/ Alex Van Boxel


On Thu, Aug 22, 2019 at 12:38 AM Srinivasa Rao Chirathanagandla <chsr...@gmail.com> wrote:
Hi,

Is there a way to convert the go class to protobuf? I want to convert the following to .proto file.


Thanks in advance.

Regards,
Srinivas

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prot...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages