MCPcopy Create free account
hub / github.com/apache/thrift / WriteBool

Method WriteBool

lib/go/thrift/compact_protocol.go:285–299  ·  view source on GitHub ↗
(ctx context.Context, value bool)

Source from the content-addressed store, hash-verified

283func (p *TCompactProtocol) WriteSetEnd(ctx context.Context) error { return nil }
284
285func (p *TCompactProtocol) WriteBool(ctx context.Context, value bool) error {
286 v := byte(COMPACT_BOOLEAN_FALSE)
287 if value {
288 v = byte(COMPACT_BOOLEAN_TRUE)
289 }
290 if p.booleanFieldPending {
291 // we haven't written the field header yet
292 _, err := p.writeFieldBeginInternal(ctx, p.booleanFieldName, BOOL, p.booleanFieldId, v)
293 p.booleanFieldPending = false
294 return NewTProtocolException(err)
295 }
296 // we're not part of a field, so just write the value.
297 err := p.writeByteDirect(v)
298 return NewTProtocolException(err)
299}
300
301// Write a byte. Nothing to see here!
302func (p *TCompactProtocol) WriteByte(ctx context.Context, value int8) error {

Callers

nothing calls this directly

Calls 3

writeByteDirectMethod · 0.95
NewTProtocolExceptionFunction · 0.85

Tested by

no test coverage detected