diff --git a/v2/broker/redis/redis.go b/v2/broker/redis/redis.go index 9e6e178c..75a8be64 100644 --- a/v2/broker/redis/redis.go +++ b/v2/broker/redis/redis.go @@ -165,7 +165,7 @@ func (b *redisBroker) Connect() error { } else { addr = b.opts.Addrs[0] - if !strings.HasPrefix("redis://", addr) { + if !strings.HasPrefix(addr, "redis://") { addr = "redis://" + addr } } diff --git a/v3/broker/redis/redis.go b/v3/broker/redis/redis.go index 830ea0a3..8a9b2db5 100644 --- a/v3/broker/redis/redis.go +++ b/v3/broker/redis/redis.go @@ -165,7 +165,7 @@ func (b *redisBroker) Connect() error { } else { addr = b.opts.Addrs[0] - if !strings.HasPrefix("redis://", addr) { + if !strings.HasPrefix(addr, "redis://") { addr = "redis://" + addr } } diff --git a/v4/broker/redis/redis.go b/v4/broker/redis/redis.go index 1d3a1769..1b7cf182 100644 --- a/v4/broker/redis/redis.go +++ b/v4/broker/redis/redis.go @@ -165,7 +165,7 @@ func (b *redisBroker) Connect() error { } else { addr = b.opts.Addrs[0] - if !strings.HasPrefix("redis://", addr) { + if !strings.HasPrefix(addr, "redis://") { addr = "redis://" + addr } } diff --git a/v5/broker/redis/redis.go b/v5/broker/redis/redis.go index ba811288..e261ced2 100644 --- a/v5/broker/redis/redis.go +++ b/v5/broker/redis/redis.go @@ -165,7 +165,7 @@ func (b *redisBroker) Connect() error { } else { addr = b.opts.Addrs[0] - if !strings.HasPrefix("redis://", addr) { + if !strings.HasPrefix(addr, "redis://") { addr = "redis://" + addr } }