From 121cfc5792a765c2815d159af294487a266c1366 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Sat, 2 May 2015 16:19:22 +0300 Subject: [PATCH] Remove deprecated funcs. --- cluster.go | 2 +- command_test.go | 2 +- commands_test.go | 2 +- example_test.go | 6 +++--- multi_test.go | 2 +- pipeline_test.go | 2 +- pubsub_test.go | 2 +- redis.go | 12 ------------ redis_test.go | 6 +++--- 9 files changed, 12 insertions(+), 24 deletions(-) diff --git a/cluster.go b/cluster.go index f5fbaf7..1189ba6 100644 --- a/cluster.go +++ b/cluster.go @@ -81,7 +81,7 @@ func (c *ClusterClient) getClient(addr string) (*Client, error) { if !ok { opt := c.opt.clientOptions() opt.Addr = addr - client = NewTCPClient(opt) + client = NewClient(opt) c.clients[addr] = client } c.clientsMx.Unlock() diff --git a/command_test.go b/command_test.go index 633c8a5..d07bbca 100644 --- a/command_test.go +++ b/command_test.go @@ -15,7 +15,7 @@ var _ = Describe("Command", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, }) }) diff --git a/commands_test.go b/commands_test.go index 485b3e8..b451c52 100644 --- a/commands_test.go +++ b/commands_test.go @@ -16,7 +16,7 @@ var _ = Describe("Commands", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, PoolTimeout: 30 * time.Second, }) diff --git a/example_test.go b/example_test.go index bf94040..230a558 100644 --- a/example_test.go +++ b/example_test.go @@ -10,14 +10,14 @@ import ( var client *redis.Client func init() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: ":6379", }) client.FlushDb() } -func ExampleNewTCPClient() { - client := redis.NewTCPClient(&redis.Options{ +func ExampleNewClient() { + client := redis.NewClient(&redis.Options{ Addr: "localhost:6379", Password: "", // no password set DB: 0, // use default DB diff --git a/multi_test.go b/multi_test.go index eab870c..0a8eac9 100644 --- a/multi_test.go +++ b/multi_test.go @@ -11,7 +11,7 @@ var _ = Describe("Multi", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, }) }) diff --git a/pipeline_test.go b/pipeline_test.go index d250d45..8a6c09d 100644 --- a/pipeline_test.go +++ b/pipeline_test.go @@ -14,7 +14,7 @@ var _ = Describe("Pipelining", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, }) }) diff --git a/pubsub_test.go b/pubsub_test.go index d67f745..408a42c 100644 --- a/pubsub_test.go +++ b/pubsub_test.go @@ -14,7 +14,7 @@ var _ = Describe("PubSub", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, }) }) diff --git a/redis.go b/redis.go index d03425c..e38098e 100644 --- a/redis.go +++ b/redis.go @@ -188,15 +188,3 @@ func NewClient(clOpt *Options) *Client { } return newClient(opt, newConnPool(newConnFunc(dialer), opt)) } - -// Deprecated. Use NewClient instead. -func NewTCPClient(opt *Options) *Client { - opt.Network = "tcp" - return NewClient(opt) -} - -// Deprecated. Use NewClient instead. -func NewUnixClient(opt *Options) *Client { - opt.Network = "unix" - return NewClient(opt) -} diff --git a/redis_test.go b/redis_test.go index 62068d0..1457dad 100644 --- a/redis_test.go +++ b/redis_test.go @@ -28,7 +28,7 @@ var _ = Describe("Client", func() { var client *redis.Client BeforeEach(func() { - client = redis.NewTCPClient(&redis.Options{ + client = redis.NewClient(&redis.Options{ Addr: redisAddr, }) }) @@ -98,7 +98,7 @@ var _ = Describe("Client", func() { }) It("should support idle-timeouts", func() { - idle := redis.NewTCPClient(&redis.Options{ + idle := redis.NewClient(&redis.Options{ Addr: redisAddr, IdleTimeout: 100 * time.Microsecond, }) @@ -110,7 +110,7 @@ var _ = Describe("Client", func() { }) It("should support DB selection", func() { - db1 := redis.NewTCPClient(&redis.Options{ + db1 := redis.NewClient(&redis.Options{ Addr: redisAddr, DB: 1, })