pool/blockingPool.go
func (p *blockingPool) Get() (net.Conn, error) {
	//in case that pool is closed or pool.conns is set to nil
	conns := p.conns
	if conns == nil {
		return nil, ErrClosed
	}

	select {
	case conn := <-conns:
		if time.Since(conn.start) > p.livetime {
			if conn.Conn != nil {
				conn.Conn.Close()
				conn.Conn = nil
			}
		}
		if conn.Conn == nil {
			var err error
			conn.Conn, err = p.factory()
			if err != nil {
				conn.start = time.Now()
				p.put(conn)
				return nil, err
			}
		}
		conn.unusable = false
		return conn, nil
	case <-time.After(time.Second*p.timeout):
		return nil, ErrTimeout
	}
}
func (p *blockingPool) Get() (net.Conn, error) {
	//in case that pool is closed or pool.conns is set to nil
	conns := p.conns
	if conns == nil {
		return nil, ErrClosed
	}

	select {
	case conn := <-conns:
		if time.Since(conn.start) > p.livetime {
			if conn.Conn != nil {
				conn.Conn.Close()
				conn.Conn = nil
			}
		}
		if conn.Conn == nil {
			var err error
			conn.Conn, err = p.factory()
			if err != nil {
				conn.start = time.Now()
				p.put(conn)
				return nil, err
			}
		}
		conn.unusable = false
		return conn, nil
	case <-time.After(time.Second*p.timeout):
		return nil, ErrTimeout
	}
}
//Get blocks for an available connection.