mirror of
https://github.com/redis/go-redis.git
synced 2025-09-11 18:10:43 +03:00
chore(doc): improve code readability (#3446)
- replace two similar functions `appendUniqueNode` and `appendIfNotExists` with a generic function. - simplify the implementation of the `get` method in `clusterNodes` - keep the member name `_generation` of `clusterNodes` consistent with other types. - rename a data member `_masterAddr` to `masterAddr`. Signed-off-by: Xiaolong Chen <fukua95@gmail.com>
This commit is contained in:
2
redis.go
2
redis.go
@@ -383,7 +383,7 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
|
||||
|
||||
// for redis-server versions that do not support the HELLO command,
|
||||
// RESP2 will continue to be used.
|
||||
if err = conn.Hello(ctx, c.opt.Protocol, username, password, c.opt.ClientName).Err(); err == nil {
|
||||
if err = conn.Hello(ctx, c.opt.Protocol, username, password, c.opt.ClientName).Err(); err == nil {
|
||||
// Authentication successful with HELLO command
|
||||
} else if !isRedisError(err) {
|
||||
// When the server responds with the RESP protocol and the result is not a normal
|
||||
|
Reference in New Issue
Block a user