From 59cd0659a583875155552457141cddfbfb1194fd Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Fri, 10 Jul 2020 05:33:35 -0700 Subject: [PATCH] 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. --- codec/json.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/codec/json.go b/codec/json.go index 61099a7145..eca4dc1207 100644 --- a/codec/json.go +++ b/codec/json.go @@ -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 -}