Return pure redis.ErrNil, so 'nil return' can be detected.#5
Return pure redis.ErrNil, so 'nil return' can be detected.#5kakaLQY wants to merge 1 commit intoEverythingMe:masterfrom
Conversation
…erent from other error.
|
why can't you detect nil the usual way? formatting the way I do is the recommended way in go. |
|
An example: if jobs, err := client.GetMulti(10, 20*time.Second, queues...); err != nil && err != redis.ErrNil {
log.Println(err)
}If |
|
I'd rather handle this case internally and not trust redigo errors, I might change the internal client, I don't want to commit to keeping redigo under the hood. |
|
You can jump in this line. vals, err := redis.Values(c.conn.Do("GETJOB", args...))And the If you don't want to keep redigo, you can also define an error type such as |
redis.ErrNil can be easily detected and a timeout is got, which is different from other errors.