MCPcopy Index your code
hub / github.com/CrowdStrike/csproto / EncodeString

Method EncodeString

encoder.go:36–39  ·  view source on GitHub ↗

EncodeString writes a length-delimited string value to the buffer preceded by the varint-encoded tag key.

(tag int, s string)

Source from the content-addressed store, hash-verified

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) {
37 b := e.stringToBytes(s)
38 e.EncodeBytes(tag, b)
39}
40
41// EncodeBytes writes a length-delimited byte slice to the buffer preceded by the varint-encoded tag key.
42func (e *Encoder) EncodeBytes(tag int, v []byte) {

Callers 15

BenchmarkEncodeStringFunction · 0.95
MarshalToMethod · 0.95
FuzzStringsFunction · 0.95
TestEncodeStringFunction · 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 2

stringToBytesMethod · 0.95
EncodeBytesMethod · 0.95

Tested by 4

BenchmarkEncodeStringFunction · 0.76
MarshalToMethod · 0.76
FuzzStringsFunction · 0.76
TestEncodeStringFunction · 0.64