Marshal serializes a protobuf message as JSON into w.
(w io.Writer, m proto.Message)
| 65 | |
| 66 | // Marshal serializes a protobuf message as JSON into w. |
| 67 | func (jm *Marshaler) Marshal(w io.Writer, m proto.Message) error { |
| 68 | b, err := jm.marshal(m) |
| 69 | if len(b) > 0 { |
| 70 | if _, err := w.Write(b); err != nil { |
| 71 | return err |
| 72 | } |
| 73 | } |
| 74 | return err |
| 75 | } |
| 76 | |
| 77 | // MarshalToString serializes a protobuf message as JSON in string form. |
| 78 | func (jm *Marshaler) MarshalToString(m proto.Message) (string, error) { |
nothing calls this directly
no test coverage detected