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 05:33:35 -07:00 committed by GitHub
parent c9ec4be3a8
commit 59cd0659a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 18 deletions

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
}