You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What are your thoughts on passing c.Context() (defaults to context.Background()) instead of c.ctx so the context is never nil? It's strongly recommended on https://golang.org/pkg/context/ to not pass a nil context.
There are a few other places where c.ctx is passed where c.Context() could be passed instead: ring.go, sentinel.go, and tx.go
The text was updated successfully, but these errors were encountered:
c.ctx is supposed to never have a nil value - it is initialized with context.Background() when client is created. c.Context() just returns c,ctx so there will not be any difference.
Uh oh!
There was an error while loading. Please reload this page.
Version: 6bc7daa
Certain methods, such as
func (c *Client) Process(cmd Cmder) error
, will default pass a nil context. https://github.com/go-redis/redis/blob/6bc7daa5b1e86745a6976ac1c4dfe6c76ea6af1f/redis.go#L511What are your thoughts on passing
c.Context()
(defaults tocontext.Background()
) instead ofc.ctx
so the context is never nil? It's strongly recommended on https://golang.org/pkg/context/ to not pass a nil context.There are a few other places where
c.ctx
is passed wherec.Context()
could be passed instead:ring.go
,sentinel.go
, andtx.go
The text was updated successfully, but these errors were encountered: