How can I return readonly protos in go?

9 views
Skip to first unread message

Richard Jiang

unread,
Oct 15, 2019, 2:50:55 PM10/15/19
to Protocol Buffers
If I have a function that returns a proto and I want the proto to be read-only, what is the best way to achieve that in go?

In c++, I can return a const reference, and in java, the proto itself is always read-only.
However, go proto exports all members and allows user to overwrite. Is there a way to prevent user accidentally writes to the proto?
Reply all
Reply to author
Forward
0 new messages