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

Method readIfNull

lib/go/thrift/simple_json_protocol.go:1153–1174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1151}
1152
1153func (p *TSimpleJSONProtocol) readIfNull() (bool, error) {
1154 cont := true
1155 for cont {
1156 b, _ := p.reader.Peek(1)
1157 if len(b) < 1 {
1158 return false, nil
1159 }
1160 switch b[0] {
1161 default:
1162 return false, nil
1163 case JSON_NULL[0]:
1164 cont = false
1165 case ' ', '\n', '\r', '\t':
1166 p.reader.ReadByte()
1167 }
1168 }
1169 if p.safePeekContains(JSON_NULL) {
1170 p.reader.Read(make([]byte, len(JSON_NULL)))
1171 return true, nil
1172 }
1173 return false, nil
1174}
1175
1176func (p *TSimpleJSONProtocol) readQuoteIfNext() {
1177 b, _ := p.reader.Peek(1)

Callers 3

ParseObjectEndMethod · 0.95
ParseListEndMethod · 0.95
readNumericMethod · 0.95

Calls 3

safePeekContainsMethod · 0.95
ReadByteMethod · 0.65
ReadMethod · 0.65

Tested by

no test coverage detected