From 374ab8ef43c4f2ada64e08b82c5f6a29f03bbcf0 Mon Sep 17 00:00:00 2001 From: Rueian Date: Sun, 26 Dec 2021 20:48:12 +0800 Subject: [PATCH] refactor: export IsRedisNil by func --- rueidis.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rueidis.go b/rueidis.go index cef062c2..904d6e16 100644 --- a/rueidis.go +++ b/rueidis.go @@ -14,10 +14,7 @@ const ( DefaultPoolSize = 1000 ) -var ( - IsRedisNil = proto.IsRedisNil - ErrConnClosing = errors.New("connection is closing") -) +var ErrConnClosing = errors.New("connection is closing") type ConnOption struct { // CacheSizeEachConn is redis client side cache size that bind to each TCP connection to a single redis instance. @@ -50,6 +47,10 @@ func NewSingleClient(option SingleClientOption) (*SingleClient, error) { return newSingleClient(option, makeConn) } +func IsRedisNil(err error) bool { + return proto.IsRedisNil(err) +} + func makeConn(dst string, opt ConnOption) conn { return makeMux(dst, opt, dial) }