1
0
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:
Vladimir Mihailenco
2015-01-30 17:06:49 +02:00
15 changed files with 3231 additions and 3378 deletions

View File

@ -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{