Skip to content

Commit

Permalink
refactor: remove unnecessary nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
rueian committed Sep 4, 2023
1 parent 1eb1725 commit 0612354
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rueidis.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,9 @@ func NewClient(option ClientOption) (client Client, err error) {
return newSingleClient(&option, nil, makeConn)
}
if client, err = newClusterClient(&option, makeConn); err != nil {
if client == nil || client == (*clusterClient)(nil) {
if client == (*clusterClient)(nil) {
return nil, err
}

if len(option.InitAddress) == 1 && (err.Error() == redisErrMsgCommandNotAllow || strings.Contains(strings.ToUpper(err.Error()), "CLUSTER")) {
option.PipelineMultiplex = singleClientMultiplex(pmbk)
client, err = newSingleClient(&option, client.(*clusterClient).single(), makeConn)
Expand Down

0 comments on commit 0612354

Please sign in to comment.