mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Merge pull request #64 from go-redis/feature/ginkgo-suite
Use ginkgo test suite
This commit is contained in:
9
redis.go
9
redis.go
@ -170,6 +170,13 @@ type Options struct {
|
||||
IdleTimeout time.Duration
|
||||
}
|
||||
|
||||
func (opt *Options) getNetwork() string {
|
||||
if opt.Network == "" {
|
||||
return "tcp"
|
||||
}
|
||||
return opt.Network
|
||||
}
|
||||
|
||||
func (opt *Options) getPoolSize() int {
|
||||
if opt.PoolSize == 0 {
|
||||
return 10
|
||||
@ -207,7 +214,7 @@ func NewClient(clOpt *Options) *Client {
|
||||
dialer := clOpt.Dialer
|
||||
if dialer == nil {
|
||||
dialer = func() (net.Conn, error) {
|
||||
return net.DialTimeout(clOpt.Network, clOpt.Addr, opt.DialTimeout)
|
||||
return net.DialTimeout(clOpt.getNetwork(), clOpt.Addr, opt.DialTimeout)
|
||||
}
|
||||
}
|
||||
return &Client{
|
||||
|
Reference in New Issue
Block a user