From 9f40911f28f065dfcbcea0f7d266458ff6937f04 Mon Sep 17 00:00:00 2001 From: Dimitrij Denissenko Date: Wed, 9 Mar 2016 09:49:05 +0000 Subject: [PATCH] Correct method accessors --- commands.go | 4 ++-- pipeline.go | 2 +- redis.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/commands.go b/commands.go index 5e202ad..c523534 100644 --- a/commands.go +++ b/commands.go @@ -583,7 +583,7 @@ func (c *commandable) SetNX(key string, value interface{}, expiration time.Durat // Redis `SET key value [expiration] XX` command. // // Zero expiration means the key has no expiration time. -func (c *Client) SetXX(key string, value interface{}, expiration time.Duration) *BoolCmd { +func (c *commandable) SetXX(key string, value interface{}, expiration time.Duration) *BoolCmd { var cmd *BoolCmd if usePrecise(expiration) { cmd = NewBoolCmd("SET", key, value, "PX", formatMs(expiration), "XX") @@ -1282,7 +1282,7 @@ func (c *commandable) ZRevRangeByScore(key string, opt ZRangeByScore) *StringSli return c.zRevRangeBy("ZREVRANGEBYSCORE", key, opt) } -func (c commandable) ZRevRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd { +func (c *commandable) ZRevRangeByLex(key string, opt ZRangeByScore) *StringSliceCmd { return c.zRevRangeBy("ZREVRANGEBYLEX", key, opt) } diff --git a/pipeline.go b/pipeline.go index 56ff965..8c800be 100644 --- a/pipeline.go +++ b/pipeline.go @@ -11,7 +11,7 @@ import ( type Pipeline struct { commandable - client *baseClient + client baseClient mu sync.Mutex // protects cmds cmds []Cmder diff --git a/redis.go b/redis.go index 5dbaac0..488bfb9 100644 --- a/redis.go +++ b/redis.go @@ -183,12 +183,12 @@ func (opt *Options) getIdleTimeout() time.Duration { // underlying connections. It's safe for concurrent use by multiple // goroutines. type Client struct { - *baseClient + baseClient commandable } func newClient(opt *Options, pool pool) *Client { - base := &baseClient{opt: opt, connPool: pool} + base := baseClient{opt: opt, connPool: pool} return &Client{ baseClient: base, commandable: commandable{process: base.process},