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:
parent
c9ec4be3a8
commit
59cd0659a5
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue