1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Make readOnly a private field so that only cluster client can use it

This commit is contained in:
wenjun.yan
2017-07-25 10:35:41 +09:00
parent e8e77ae5e4
commit 4e1d2a01db
4 changed files with 7 additions and 9 deletions

View File

@ -68,7 +68,7 @@ func (c *baseClient) initConn(cn *pool.Conn) error {
if c.opt.Password == "" &&
c.opt.DB == 0 &&
!c.opt.ReadOnly &&
!c.opt.readOnly &&
c.opt.OnConnect == nil {
return nil
}
@ -91,7 +91,7 @@ func (c *baseClient) initConn(cn *pool.Conn) error {
pipe.Select(c.opt.DB)
}
if c.opt.ReadOnly {
if c.opt.readOnly {
pipe.ReadOnly()
}