codec: remove unused and untest ProtoMarshalJSONIndent (#6668)

Noticed from coverage reports and from offline consultation
with Alexander and Aaron, that this function can be removed.
This commit is contained in:
Emmanuel T Odeke
2020-07-10 14:33:35 +02:00
committed by GitHub
parent c9ec4be3a8
commit 59cd0659a5
-18
View File
@@ -26,21 +26,3 @@ func ProtoMarshalJSON(msg proto.Message) ([]byte, error) {
return buf.Bytes(), nil
}
// ProtoMarshalJSONIndent provides an auxiliary function to return Proto3 indented
// JSON encoded bytes of a message.
func ProtoMarshalJSONIndent(msg proto.Message) ([]byte, error) {
jm := &jsonpb.Marshaler{EmitDefaults: false, OrigName: false, Indent: " "}
err := types.UnpackInterfaces(msg, types.ProtoJSONPacker{JSONPBMarshaler: jm})
if err != nil {
return nil, err
}
buf := new(bytes.Buffer)
if err := jm.Marshal(buf, msg); err != nil {
return nil, err
}
return buf.Bytes(), nil
}