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

Method DecodeVarint

proto/buffer.go:189–196  ·  view source on GitHub ↗

DecodeVarint consumes an encoded unsigned varint from the buffer.

()

Source from the content-addressed store, hash-verified

187
188// DecodeVarint consumes an encoded unsigned varint from the buffer.
189func (b *Buffer) DecodeVarint() (uint64, error) {
190 v, n := protowire.ConsumeVarint(b.buf[b.idx:])
191 if n < 0 {
192 return 0, protowire.ParseError(n)
193 }
194 b.idx += n
195 return uint64(v), nil
196}
197
198// DecodeZigzag32 consumes an encoded 32-bit zig-zag varint from the buffer.
199func (b *Buffer) DecodeZigzag32() (uint64, error) {

Callers 3

DecodeZigzag32Method · 0.95
DecodeZigzag64Method · 0.95
TestNumericPrimitivesFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestNumericPrimitivesFunction · 0.64