Open 3052 opened 11 months ago
as a workaround I wrote this module that uses the standard encoding:
package main
import (
"154.pages.dev/protobuf"
"fmt"
)
func main() {
data := protobuf.Message{
6: {
protobuf.Message{
1: {protobuf.Bytes("key")},
},
protobuf.Message{
1: {protobuf.Bytes("key")},
},
},
}.Marshal()
fmt.Printf("%q\n", data)
}
Using this code:
I get this result:
If I run similar code with
github.com/golang/protobuf/proto
, I get:I think the difference is because of this:
https://github.com/philpearl/plenc#is-this-protobuf
I think its good that Plenc offers improved encoding, but it seems that both client and server would need to be using Plenc. If client was using Plenc and server not, then it seems server would reject the Plenc encoded message. If this is the case, then I think the standard encoding should also be offered, either via another function, or an option.