fixup nil pointer assign
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
7c641fa8ac
commit
27eccc1ed2
8
redis.go
8
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user