I’m curious what you don’t like about it? I haven’t used Go in anger, but I love protobufs, and it’s shocking that Go, of all languages, would have a substandard implementation.
My other main gripe is that the generated structs embed a mutex, and so can't be copied, compared [ergonomically], or passed by value.
Sadly, both of these issues are explained away as on the issue tracker.
(My use-case is primarily to share data structures across languages, so perhaps it's not totally aligned with what protobufs is trying to do. I just wish there was a better alternative.)
Been a few years since I’ve used Go protobuf library, but it left a sour taste. First memory allocations are awful and slow. At the time there was no way to reuse slices for serializer when serializing and deserializing. The library would often panic instead of returning an error (this basically why we switched to an alternative library).
In particular, oneofs are *so* awful to work with that I'm often tempted to use an Any instead. For example:
Should, in my opinion, lead to code like this: But the reality looks more like this: My other main gripe is that the generated structs embed a mutex, and so can't be copied, compared [ergonomically], or passed by value.Sadly, both of these issues are explained away as on the issue tracker.
(My use-case is primarily to share data structures across languages, so perhaps it's not totally aligned with what protobufs is trying to do. I just wish there was a better alternative.)