On May 8, 2020, at 1:56 PM, cheng dong <qq451...@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...@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.
i think it comes down to the competing demands of the data representations of different applications, and keeping a clean, minimal layout on the wire. i ended up with a disappointing amount of boilerplate code per RPC.
i decided this is the price i have to pay for the type security that protobufs offer. if anyone comes up with a clean solution i would be interested.
-Steve
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/dc6ff8cd-a52a-49a4-8c28-4d0259293ad1%40googlegroups.com.