code: func (c *Conn) sendAlert(err Alert) error {
  	c.handshakeMutex.Lock()
  	defer c.handshakeMutex.Unlock()
  
  	var level int
  	switch err {
  	case AlertNoRenegotiation, AlertCloseNotify:
  		level = AlertLevelWarning
  	default:
  		level = AlertLevelError
  	}
  
  	buf := []byte{byte(err), byte(level)}
  	c.out.WriteRecord(&TLSPlaintext{
  		contentType: RecordTypeAlert,
  		fragment:    buf,
  	})
  
  	// close_notify and end_of_early_data are not actually errors
  	if level == AlertLevelWarning {
  		return &net.OpError{Op: "local error", Err: err}
  	}
  
  	return c.Close()
  }
docs: // sendAlert sends a TLS alert message.
  // c.out.Mutex <= L.