protobuf-go/cmd
Joe Tsai bda671fa93 cmd/protoc-gen-go: re-escape default byte values
Historically, protoc-gen-go outputted the escaped form of bytes as provided by
protoc verbatim. This behavior is buggy, but nothing really uses this tag
since default values are properties of getters instead of serialization.
Rather than fixing it, just preserve prior behavior. Otherwise, logic depending
on the old legacy behavior will not be able to distinguish between the unescaped
or the escaped forms.

Furthermore, since protoc-gen-go historically copied the protoc output verbatim,
we will need to escape the default bytes in a way that is identical to the
CEscape function from strutil.cc of the protoc source code.

Change-Id: I0ab55e220ae430dd123ad050406e285788f6cb40
Reviewed-on: https://go-review.googlesource.com/c/143543
Reviewed-by: Damien Neil <dneil@google.com>
2018-10-22 17:14:19 +00:00
..
protoc-gen-go cmd/protoc-gen-go: re-escape default byte values 2018-10-22 17:14:19 +00:00
protoc-gen-go-grpc protogen: move comment generation into protogen 2018-10-17 21:03:49 +00:00