MCPcopy Create free account
hub / github.com/CrowdStrike/csproto / EncodeBool

Method EncodeBool

encoder.go:25–33  ·  view source on GitHub ↗

EncodeBool writes a varint-encoded boolean value to the buffer preceded by the varint-encoded tag key.

(tag int, v bool)

Source from the content-addressed store, hash-verified

23
24// EncodeBool writes a varint-encoded boolean value to the buffer preceded by the varint-encoded tag key.
25func (e *Encoder) EncodeBool(tag int, v bool) {
26 e.offset += EncodeTag(e.p[e.offset:], tag, WireTypeVarint)
27 if v {
28 e.p[e.offset] = 1
29 } else {
30 e.p[e.offset] = 0
31 }
32 e.offset++
33}
34
35// EncodeString writes a length-delimited string value to the buffer preceded by the varint-encoded tag key.
36func (e *Encoder) EncodeString(tag int, s string) {

Callers 15

FuzzBoolsFunction · 0.95
TestEncodeBoolFunction · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80
MarshalToMethod · 0.80

Calls 1

EncodeTagFunction · 0.85

Tested by 2

FuzzBoolsFunction · 0.76
TestEncodeBoolFunction · 0.64