From 27eccc1ed2a3807d46ec9579fed2a1e93d3d1be8 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 8 Oct 2024 16:52:26 +0300 Subject: [PATCH] fixup nil pointer assign Signed-off-by: Vasiliy Tolstov --- redis.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/redis.go b/redis.go index 67b2f44..e951663 100755 --- a/redis.go +++ b/redis.go @@ -625,12 +625,12 @@ func NewStore(opts ...store.Option) *Store { } func (r *Store) configure() error { - universalOptions := &goredis.UniversalOptions{} - if r.cli != nil && r.opts.Context == nil { return nil } + universalOptions := DefaultUniversalOptions + if r.opts.Context != nil { if o, ok := r.opts.Context.Value(configKey{}).(*goredis.Options); ok { universalOptions.Addrs = []string{o.Addr} @@ -704,10 +704,6 @@ func (r *Store) configure() error { } } - if universalOptions == nil { - universalOptions = DefaultUniversalOptions - } - if len(r.opts.Addrs) > 0 { universalOptions.Addrs = r.opts.Addrs } else {