MCPcopy
hub / github.com/golang/protobuf / Marshal

Method Marshal

proto/text_encode.go:32–40  ·  view source on GitHub ↗

Marshal writes the proto text format of m to w.

(w io.Writer, m Message)

Source from the content-addressed store, hash-verified

30
31// Marshal writes the proto text format of m to w.
32func (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.
43func (tm *TextMarshaler) Text(m Message) string {

Callers

nothing calls this directly

Calls 2

marshalMethod · 0.95
WriteMethod · 0.45

Tested by

no test coverage detected