code: func (c *rawConnection) Close(err error) {
  	c.sendCloseOnce.Do(func() {
  		done := make(chan struct{})
  		c.send(&Close{err.Error()}, done)
  		select {
  		case <-done:
  		case <-c.closed:
  		}
  	})
  
  	c.internalClose(err)
  }
docs: // Close is called when the connection is regularely closed and thus the Close
  // BEP message is sent before terminating the actual connection. The error
  // argument specifies the reason for closing the connection.