MCPcopy
hub / github.com/grafana/dskit / MarshalToSizedBuffer

Method MarshalToSizedBuffer

middleware/middleware_test/echo_server.pb.go:267–280  ·  view source on GitHub ↗
(dAtA []byte)

Source from the content-addressed store, hash-verified

265}
266
267func (m *Msg) MarshalToSizedBuffer(dAtA []byte) (int, error) {
268 i := len(dAtA)
269 _ = i
270 var l int
271 _ = l
272 if len(m.Body) > 0 {
273 i -= len(m.Body)
274 copy(dAtA[i:], m.Body)
275 i = encodeVarintEchoServer(dAtA, i, uint64(len(m.Body)))
276 i--
277 dAtA[i] = 0xa
278 }
279 return len(dAtA) - i, nil
280}
281
282func encodeVarintEchoServer(dAtA []byte, offset int, v uint64) int {
283 offset -= sovEchoServer(v)

Callers 3

XXX_MarshalMethod · 0.95
MarshalMethod · 0.95
MarshalToMethod · 0.95

Calls 1

encodeVarintEchoServerFunction · 0.85

Tested by

no test coverage detected