code: func NewChannelPool(poolConfig *Config) (Pool, error) {
  	if poolConfig.InitialCap < 0 || poolConfig.MaxCap <= 0 || poolConfig.InitialCap > poolConfig.MaxCap {
  		return nil, errors.New("invalid capacity settings")
  	}
  	if poolConfig.Factory == nil {
  		return nil, errors.New("invalid factory func settings")
  	}
  	if poolConfig.Close == nil {
  		return nil, errors.New("invalid close func settings")
  	}
  
  	c := &channelPool{
  		conns:       make(chan *idleConn, poolConfig.MaxCap),
  		factory:     poolConfig.Factory,
  		close:       poolConfig.Close,
  		idleTimeout: poolConfig.IdleTimeout,
  	}
  
  	if poolConfig.Ping != nil {
  		c.ping = poolConfig.Ping
  	}
  
  	for i := 0; i < poolConfig.InitialCap; i++ {
  		conn, err := c.factory()
  		if err != nil {
  			c.Release()
  			return nil, fmt.Errorf("factory is not able to fill the pool: %s", err)
  		}
  		c.conns <- &idleConn{conn: conn, t: time.Now()}
  	}
  
  	return c, nil
  }
docs: // NewChannelPool 初始化连接