chore: replace redis.NewRedis with redis.New (#1103)

This commit is contained in:
Kevin Wan
2021-09-29 23:01:10 +08:00
committed by GitHub
parent cd21c9fa74
commit e43357164c
7 changed files with 12 additions and 12 deletions

View File

@@ -963,7 +963,7 @@ func TestRedis_Pipelined(t *testing.T) {
func TestRedisString(t *testing.T) {
runOnRedis(t, func(client *Redis) {
client.Ping()
_, err := getRedis(NewRedis(client.Addr, ClusterType))
_, err := getRedis(New(client.Addr, Cluster()))
assert.Nil(t, err)
assert.Equal(t, client.Addr, client.String())
assert.NotNil(t, New(client.Addr, badType()).Ping())
@@ -1075,7 +1075,7 @@ func TestRedisGeo(t *testing.T) {
func TestRedis_WithPass(t *testing.T) {
runOnRedis(t, func(client *Redis) {
err := NewRedis(client.Addr, NodeType, "any").Ping()
err := New(client.Addr, WithPass("any")).Ping()
assert.NotNil(t, err)
})
}
@@ -1095,7 +1095,7 @@ func runOnRedis(t *testing.T, fn func(client *Redis)) {
client.Close()
}
}()
fn(NewRedis(s.Addr(), NodeType))
fn(New(s.Addr()))
}
func runOnRedisTLS(t *testing.T, fn func(client *Redis)) {