MCPcopy
hub / github.com/TarsCloud/TarsGo / WriteBool

Method WriteBool

tars/protocol/codec/codec.go:216–222  ·  view source on GitHub ↗

WriteBool write bool with the tag.

(data bool, tag byte)

Source from the content-addressed store, hash-verified

214
215// WriteBool write bool with the tag.
216func (b *Buffer) WriteBool(data bool, tag byte) error {
217 tmp := int8(0)
218 if data {
219 tmp = 1
220 }
221 return b.WriteInt8(tmp, tag)
222}
223
224// WriteInt16 write the int16 with the tag.
225func (b *Buffer) WriteInt16(data int16, tag byte) error {

Callers 9

TestBuffer_boolFunction · 0.95
TestReader_SkipToNoCheckFunction · 0.95
WriteToMethod · 0.80
WriteToMethod · 0.80
WriteToMethod · 0.80
WriteToMethod · 0.80
putBaseMethod · 0.80

Calls 1

WriteInt8Method · 0.95

Tested by 2

TestBuffer_boolFunction · 0.76
TestReader_SkipToNoCheckFunction · 0.76