ReadRefFlag reads the reference flag and returns: - flag: the flag value - refId: the reference ID if flag is RefFlag - needRead: true if we need to read the actual data
(ctx *ReadContext)
| 431 | // - refId: the reference ID if flag is RefFlag |
| 432 | // - needRead: true if we need to read the actual data |
| 433 | func (r *RefReader) ReadRefFlag(ctx *ReadContext) (flag int8, refId int32, needRead bool) { |
| 434 | flag = ctx.RawInt8() |
| 435 | switch flag { |
| 436 | case NullFlag: |
| 437 | return flag, 0, false |
| 438 | case RefFlag: |
| 439 | refId = ctx.ReadVarint32() |
| 440 | return flag, refId, false |
| 441 | default: // RefValueFlag or NotNullValueFlag |
| 442 | return flag, 0, true |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | // Reference stores a reference for later retrieval |
| 447 | func (r *RefReader) Reference(value any) { |
nothing calls this directly
no test coverage detected