code: func NewTailReaderWithDelimiter(ctx context.Context, r SizeReaderAt, reqLines int, delimiter []byte) (io.Reader, int, error) {
  	if reqLines < 1 {
  		return nil, 0, ErrNonPositiveLinesNumber
  	}
  	if len(delimiter) == 0 {
  		return nil, 0, errors.New("must provide a delimiter")
  	}
  	var (
  		size      = r.Size()
  		tailStart int64
  		tailEnd   = size
  		found     int
  	)
  
  	if int64(len(delimiter)) >= size {
  		return bytes.NewReader(nil), 0, nil
  	}
  
  	scanner := newScanner(r, delimiter)
  	for scanner.Scan(ctx) {
  		if err := scanner.Err(); err != nil {
  			return nil, 0, scanner.Err()
  		}
  
  		found++
  		if found == 1 {
  			tailEnd = scanner.End()
  		}
  		if found == reqLines {
  			break
  		}
  	}
  
  	tailStart = scanner.Start(ctx)
  
  	if found == 0 {
  		return bytes.NewReader(nil), 0, nil
  	}
  
  	if found < reqLines && tailStart != 0 {
  		tailStart = 0
  	}
  	return io.NewSectionReader(r, tailStart, tailEnd-tailStart), found, nil
  }
docs: // NewTailReaderWithDelimiter scopes the passed in reader to just the last N lines passed in
  // In this case a "line" is defined by the passed in delimiter.
  //
  // Delimiter lengths should be generally small, no more than 12 bytes