func NewPool(newFunc NewFunc, size, limit uint, idleTimeout time.Duration) (*Pool, error) {
	p := &Pool{
		New:         newFunc,
		size:        size,
		limit:       limit,
		IdleTimeout: idleTimeout,
	}

	p.connCh = make(chan net.Conn, p.size)
	for i := 0; i < int(size); i++ {
		conn, err := p.New()
		if err != nil {
			return nil, err
		}
		p.connTotal++

		p.connCh <- conn
	}
	return p, nil
}
// NewPool new conn pool.
NewPool new conn pool.
// NewPool new conn pool .
func NewPool(newFunc NewFunc, size, limit uint, idleTimeout time.Duration) (*Pool, error) {
	p := &Pool{
		New:         newFunc,
		size:        size,
		limit:       limit,
		IdleTimeout: idleTimeout,
	}
	p.connCh = make(chan net.Conn, p.size)
	for i := 0; i < int(size); i++ {
		conn, err := p.New()
		if err != nil {
			return nil, err
		}
		p.connTotal++
		p.connCh <- conn
	}
	return p, nil
}
func NewPool ( newFunc NewFunc , size , limit uint , idleTimeout time . Duration ) ( * Pool , error ) { p := & Pool { New : newFunc , size : size , limit : limit , IdleTimeout : idleTimeout , } p . connCh = make ( chan net . Conn , p . size ) for i := 0 ; i < int ( size ) ; i ++ { conn , err := p . New ( ) if err != nil { return nil , err } p . connTotal ++ p . connCh <- conn } return p , nil }
NewPool new conn pool.
NewPool new conn pool .