Skip to content

Commit

Permalink
Add comment to explain why func is empty, sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
titpetric committed May 17, 2022
1 parent 465d542 commit e4ddb50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion storage/redis_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ func (rc *RedisController) disconnect() {
// onConnect will be called when we have established a successful redis connection
func (rc *RedisController) ConnectToRedis(ctx context.Context, onConnect func(), conf *config.Config) {
if onConnect == nil {
onConnect = func() {}
onConnect = func() {
// an empty function to avoid repeated nil checks below
}
}
c := []RedisCluster{
{
Expand Down

0 comments on commit e4ddb50

Please sign in to comment.