mirror of
https://github.com/redis/go-redis.git
synced 2025-07-20 22:42:59 +03:00
feat: add helper func, cleanup code
This commit is contained in:
12
cluster.go
12
cluster.go
@ -173,17 +173,7 @@ func ParseClusterURL(redisURL string) (*ClusterOptions, error) {
|
||||
|
||||
// add base URL to the array of addresses
|
||||
// more addresses may be added through the URL params
|
||||
h, p, err := net.SplitHostPort(u.Host)
|
||||
if err != nil {
|
||||
h = u.Host
|
||||
}
|
||||
if h == "" {
|
||||
h = "localhost"
|
||||
}
|
||||
if p == "" {
|
||||
p = "6379"
|
||||
}
|
||||
|
||||
h, p := getHostPortWithDefaults(u)
|
||||
o.Addrs = append(o.Addrs, net.JoinHostPort(h, p))
|
||||
|
||||
// setup username, password, and other configurations
|
||||
|
Reference in New Issue
Block a user