Marshal writes the proto text format of m to w.
(w io.Writer, m Message)
| 30 | |
| 31 | // Marshal writes the proto text format of m to w. |
| 32 | func (tm *TextMarshaler) Marshal(w io.Writer, m Message) error { |
| 33 | b, err := tm.marshal(m) |
| 34 | if len(b) > 0 { |
| 35 | if _, err := w.Write(b); err != nil { |
| 36 | return err |
| 37 | } |
| 38 | } |
| 39 | return err |
| 40 | } |
| 41 | |
| 42 | // Text returns a proto text formatted string of m. |
| 43 | func (tm *TextMarshaler) Text(m Message) string { |