code: func (rc *RedisConnector) NewPool(socketPath, host, password string, db int, cnf *config.RedisConfig, tlsConfig *tls.Config) *redis.Pool {
  	if cnf == nil {
  		cnf = defaultConfig
  	}
  	return &redis.Pool{
  		MaxIdle:     cnf.MaxIdle,
  		IdleTimeout: time.Duration(cnf.IdleTimeout) * time.Second,
  		MaxActive:   cnf.MaxActive,
  		Wait:        cnf.Wait,
  		Dial: func() (redis.Conn, error) {
  			c, err := rc.open(socketPath, host, password, db, cnf, tlsConfig)
  			if err != nil {
  				return nil, err
  			}
  
  			if db != 0 {
  				_, err = c.Do("SELECT", db)
  				if err != nil {
  					return nil, err
  				}
  			}
  
  			return c, err
  		},
  		// PINGs connections that have been idle more than 10 seconds
  		TestOnBorrow: func(c redis.Conn, t time.Time) error {
  			if time.Since(t) < time.Duration(10*time.Second) {
  				return nil
  			}
  			_, err := c.Do("PING")
  			return err
  		},
  	}
  }
docs: // NewPool returns a new pool of Redis connections