1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Make proto/parser an internal package

This commit is contained in:
Dimitrij Denissenko
2016-07-02 13:52:10 +01:00
parent 5c3ab24e0a
commit 7d856c5595
24 changed files with 841 additions and 712 deletions

View File

@ -205,9 +205,8 @@ func (p *ConnPool) Get() (*Conn, error) {
}
func (p *ConnPool) Put(cn *Conn) error {
if cn.Rd.Buffered() != 0 {
b, _ := cn.Rd.Peek(cn.Rd.Buffered())
err := fmt.Errorf("connection has unread data: %q", b)
if data := cn.Rd.PeekBuffered(); data != nil {
err := fmt.Errorf("connection has unread data: %q", data)
internal.Logf(err.Error())
return p.Remove(cn, err)
}