// PeekErr returns the error that will be returned by Err() next time Scan() is called. Peek() must be called first.
425170
func (g *globTokeniser) PeekErr() error {
	if g.peekErr == io.EOF {
		return nil
	}

	return g.peekErr
}
698715
func (p *Peeker) Peek() *Token {
	if p.peeked == nil {
		p.peeked = <-p.ch
	}
	return p.peeked
}
1313161
func (c *Conn) Peek(id uint64) (body []byte, err error) {
	r, err := c.cmd(nil, nil, nil, "peek", id)
	if err != nil {
		return nil, err
	}
	return c.readResp(r, true, "FOUND %d", &id)
}
1203376
func (s *scanner) peekPos() int {
	if s.readPos >= len(s.stateRecord){
		return  s.cacheRecord.pos// peek can be called when the array is over , only if unmarshal error occured, so return last read position 
	}
	if !s.cached {
		s.cached = true
		s.cacheRecord = s.stateRecord[s.readPos]
	}
	return s.cacheRecord.pos
}
1321237
func (s *Segmenter) Err() error {
	if s.err == io.EOF {
		return nil
	}
	return s.err
}
509598
func (l *pageLexer) peek() rune {
	r := l.next()
	l.backup()
	return r
}
367201
func errnoErr(e syscall.Errno) error {
	switch e {
	case 0:
		return nil
	case errnoERROR_IO_PENDING:
		return errERROR_IO_PENDING
	}
	// TODO: add more here, after collecting data on the common
	// error values see on Windows. (perhaps when running
	// all.bat?)
	return e
}
978925
func (rb *ringBuffer) Peek() (interface{}, bool) {
	if rb.start.used == false {
		return nil, false
	}
	return rb.start.value, true
}
888221
func (l *Lexer) Peek() rune {
	r := l.Next()
	l.backup()
	return r
}
930178
func (this *IntErrs) GetFirstErr() (err error) {
	for _, v := range *this {
		if nil != v.E {
			return v.E
		}
	}
	return nil
}
987143
func (p *parser) err(e error) Error {
	// convert the error to include the parser position
	return NewError(e, p.Position())
}
528042
func (it *ScanIterator) Err() error {
	it.mu.Lock()
	err := it.cmd.Err()
	it.mu.Unlock()
	return err
}
1013718
func (b *Buffer) Peek() (interface{}, error) {
	var ln int
	var v interface{}

	b.rw.RLock()
	{
		if ln = len(b.buffer); ln > 0 {
			v = b.buffer[0]
		}
	}
	b.rw.RUnlock()

	if ln == 0 {
		return nil, ErrBufferEmpty
	}

	return v, nil
}
841166
func WrappedErr(err error) error {
	cast, ok := err.(*Error)
	if !ok {
		return err
	}
	return cast.WrappedErr()
}
263517
func (c *ColorLogger) Err(bytes []byte) {
	if len(bytes) == 0 {
		return
	}
	logFmt, name := c.getLogFmt()
	message := fmt.Sprintf(logFmt, name, string(bytes))
	fmt.Fprint(os.Stderr, message)
}
513015
func toRPCErr(err error) error {
	if err == nil || err == io.EOF {
		return err
	}
	if err == io.ErrUnexpectedEOF {
		return status.Error(codes.Internal, err.Error())
	}
	if _, ok := status.FromError(err); ok {
		return err
	}
	switch e := err.(type) {
	case transport.ConnectionError:
		return status.Error(codes.Unavailable, e.Desc)
	default:
		switch err {
		case context.DeadlineExceeded:
			return status.Error(codes.DeadlineExceeded, err.Error())
		case context.Canceled:
			return status.Error(codes.Canceled, err.Error())
		}
	}
	return status.Error(codes.Unknown, err.Error())
}
694633
func (s *Scanner) setErr(err error) {
	if s.err == nil || s.err == io.EOF {
		s.err = err
	}
}