I wrote greenpack to avoid exactly this; having to maintain two structs in sync. Now I just maintain a single Go struct, and the .go source file serves as the IDL. Running go generate updates the generated serialization code.
https://github.com/glycerine/greenpack It is also faster than protobufs, or at least it was 8 years ago when I benchmarked it; of course data content will affect benchmarks and upgrades to protobufs since then have surely been made. https://github.com/glycerine/go_serialization_benchmarks -- 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/5466cdfc-f0ce-4423-aece-16c4b6e1bb6dn%40googlegroups.com.