пт, 8 мая 2020 г. в 22:22, Robert Engels <reng...@ix.netcom.com>:
>
> Have the compute struct contain the proto struct.
>

I think that question is more about how to copy fields from one struct
to another. For example one struct contains some tags (for example to
work with some db orm), and proto struct don't have such tags.

> On May 8, 2020, at 1:56 PM, cheng dong <qq451954...@gmail.com> wrote:
>
> 
> i use protobuf to do rpc in golang . for every message XXX in proto,  i have 
> to define a struct XXX in go, compute and then copy its field one by one to 
> pb.XXX(because struct XXX have some field not in pb.XXX), when i have many 
> struct XXX, it is very ineffective and very slow.
>
> so how could i use a single struct both used for compute and marshal ?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/f67468e5-cb3b-4026-903a-f7ac49402bbd%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/71BBB1B9-9CDB-4E46-A486-A1FC7BF362BC%40ix.netcom.com.



-- 
Vasiliy Tolstov,
e-mail: v.tols...@selfip.ru

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CACaajQsr06xYbv1N1Hg2Ax2KOTPeEa%2BoMowQSVdNOVgYie9kHg%40mail.gmail.com.

Reply via email to