go-redis icon indicating copy to clipboard operation
go-redis copied to clipboard

newClient should panic when failed to connect to a db

Open cruvie opened this issue 1 year ago • 2 comments

Issue tracker is used for reporting bugs and discussing new features. Please use stackoverflow for supporting issues.

newClient should panic when failed to connect to a db

Expected Behavior

panic when failed to connect to a db

Current Behavior

nothing happened

Possible Solution

panic when failed to connect to a db

Steps to Reproduce

	client := redis.NewClient(&redis.Options{
		Addr:     "127.0.0.1:7923",
		Password: "123456",
		DB:       0,
	})
	if client == nil {
		t.Error("client is nil")
	}

Context (Environment)

it leaves init error to runtime error

newClient should panic when failed to connect to a db

Detailed Description

Possible Implementation

cruvie avatar Aug 05 '24 02:08 cruvie