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

Method DebugPrint

proto/buffer.go:132–137  ·  view source on GitHub ↗

DebugPrint dumps the encoded bytes of b with a header and footer including s to stdout. This is only intended for debugging.

(s string, b []byte)

Source from the content-addressed store, hash-verified

130// DebugPrint dumps the encoded bytes of b with a header and footer including s
131// to stdout. This is only intended for debugging.
132func (*Buffer) DebugPrint(s string, b []byte) {
133 m := MessageReflect(new(unknownFields))
134 m.SetUnknown(b)
135 b, _ = prototext.MarshalOptions{AllowPartial: true, Indent: "\t"}.Marshal(m.Interface())
136 fmt.Printf("==== %s ====\n%s==== %s ====\n", s, b, s)
137}
138
139// EncodeVarint appends an unsigned varint encoding to the buffer.
140func (b *Buffer) EncodeVarint(v uint64) error {

Callers

nothing calls this directly

Calls 3

MessageReflectFunction · 0.85
InterfaceMethod · 0.80
MarshalMethod · 0.65

Tested by

no test coverage detected