add code coverage (#615)

* add code coverage

* simplify redis code
This commit is contained in:
Kevin Wan
2021-04-09 22:40:43 +08:00
committed by GitHub
parent bd82b7d8de
commit ee630b8b57
4 changed files with 201 additions and 37 deletions

View File

@@ -1742,17 +1742,9 @@ func acceptable(err error) bool {
func getRedis(r *Redis) (RedisNode, error) {
switch r.Type {
case ClusterType:
if r.tls {
return getClusterWithTLS(r.Addr, r.Pass, r.tls)
} else {
return getCluster(r.Addr, r.Pass)
}
return getCluster(r)
case NodeType:
if r.tls {
return getClientWithTLS(r.Addr, r.Pass, r.tls)
} else {
return getClient(r.Addr, r.Pass)
}
return getClient(r)
default:
return nil, fmt.Errorf("redis type '%s' is not supported", r.Type)
}