Why not use gob encoding? I am using it across nats and it is working fine. The only workaround that I have had to do is to string encode the errors and convert them back to errors on the other side.
On Friday, May 8, 2020 at 2:56:22 PM UTC-4, cheng dong 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/fb03f6e7-3550-4e0c-a92d-8df83bb46e48%40googlegroups.com.