From 9ba591c668fa723ec60c5929c3ef41d95ef7f3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=87=91=E5=AF=8C?= Date: Tue, 21 Aug 2018 09:40:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20gredis.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/database/gredis/gredis.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/g/database/gredis/gredis.go b/g/database/gredis/gredis.go index 510f382a6..ac7366645 100644 --- a/g/database/gredis/gredis.go +++ b/g/database/gredis/gredis.go @@ -59,14 +59,14 @@ func New(config Config) *Redis { if err != nil { return nil, err } - if _, err := c.Do("SELECT", config.Db); err != nil { - return nil, err - } if len(config.Pass) > 0 { if _, err := c.Do("AUTH", config.Pass); err != nil { return nil, err } } + if _, err := c.Do("SELECT", config.Db); err != nil { + return nil, err + } return c, nil }, }