Kevin Wan 2 лет назад
Родитель
Сommit
3c0dc8435e
3 измененных файлов с 6 добавлено и 1 удалено
  1. 1 0
      core/stores/redis/conf.go
  2. 1 0
      core/stores/redis/redis.go
  3. 4 1
      core/stores/redis/redis_test.go

+ 1 - 0
core/stores/redis/conf.go

@@ -29,6 +29,7 @@ type (
 	}
 )
 
+// NewRedis returns a Redis.
 // Deprecated: use MustNewRedis or NewRedis instead.
 func (rc RedisConf) NewRedis() *Redis {
 	var opts []Option

+ 1 - 0
core/stores/redis/redis.go

@@ -86,6 +86,7 @@ type (
 	StringCmd = red.StringCmd
 )
 
+// New returns a Redis with given options.
 // Deprecated: use MustNewRedis or NewRedis instead.
 func New(addr string, opts ...Option) *Redis {
 	return newRedis(addr, opts...)

+ 4 - 1
core/stores/redis/redis_test.go

@@ -1776,7 +1776,10 @@ func runOnRedis(t *testing.T, fn func(client *Redis)) {
 		}
 	}()
 
-	fn(New(s.Addr()))
+	fn(MustNewRedis(RedisConf{
+		Host: s.Addr(),
+		Type: NodeType,
+	}))
 }
 
 func runOnRedisWithError(t *testing.T, fn func(client *Redis)) {