func (p *pool) closeConnection(c *connection) error {
	if c.pool != p {
		return ErrWrongPool
	}
	p.Lock()
	delete(p.opened, c.poolID)
	p.Unlock()

	if !atomic.CompareAndSwapInt32(&c.connected, connected, disconnected) {
		return nil // We're closing an already closed connection
	}

	if c.nc != nil {
		err := c.nc.Close()
		if err != nil {
			return ConnectionError{ConnectionID: c.id, Wrapped: err, message: "failed to close net.Conn"}
		}
	}

	return nil
}
// closeConnection closes a connection, not the pool itself. This method will actually closeConnection the connection,
// making it unusable, to instead return the connection to the pool, use put.
closeConnection closes a connection, not the pool itself. This method will actually closeConnection the connection,
making it unusable, to instead return the connection to the pool, use put.
// closeConnection closes a connection not the pool itself . This method will actually closeConnection the connection // making it unusable to instead return the connection to the pool use put .
func (p *pool) closeConnection(c *connection) error {
	if c.pool != p {
		return ErrWrongPool
	}
	p.Lock()
	delete(p.opened, c.poolID)
	p.Unlock()
	if !atomic.CompareAndSwapInt32(&c.connected, connected, disconnected) {
		return nil 
	}
	if c.nc != nil {
		err := c.nc.Close()
		if err != nil {
			return ConnectionError{ConnectionID: c.id, Wrapped: err, message: "failed to close net.Conn"}
		}
	}
	return nil
}
func ( p * pool ) closeConnection ( c * connection ) error { if c . pool != p { return ErrWrongPool } p . Lock ( ) delete ( p . opened , c . poolID ) p . Unlock ( ) if ! atomic . CompareAndSwapInt32 ( & c . connected , connected , disconnected ) { return nil } if c . nc != nil { err := c . nc . Close ( ) if err != nil { return ConnectionError { ConnectionID : c . id , Wrapped : err , message : " " } } } return nil }
closeConnection closes a connection, not the pool itself.
closeConnection closes a connection not the pool itself .
// We're closing an already closed connection