Until returns a slice ends with the delim in the buffer.
(delim byte)
| 362 | |
| 363 | // Until returns a slice ends with the delim in the buffer. |
| 364 | func (b *UnsafeLinkBuffer) Until(delim byte) (line []byte, err error) { |
| 365 | n := b.indexByte(delim, 0) |
| 366 | if n < 0 { |
| 367 | return nil, untilErr |
| 368 | } |
| 369 | return b.Next(n + 1) |
| 370 | } |
| 371 | |
| 372 | // Slice returns a new LinkBuffer, which is a zero-copy slice of this LinkBuffer, |
| 373 | // and only holds the ability of Reader. |