code: func (c *Conn) Write(buffer []byte) (int, error) {
  	// Lock the output channel
  	c.out.Lock()
  	defer c.out.Unlock()
  
  	if !c.Writable() {
  		return 0, errors.New("Write called before the handshake completed (and early data not in use)")
  	}
  
  	// Send full-size fragments
  	var start int
  	sent := 0
  	for start = 0; len(buffer)-start >= maxFragmentLen; start += maxFragmentLen {
  		err := c.out.WriteRecord(&TLSPlaintext{
  			contentType: RecordTypeApplicationData,
  			fragment:    buffer[start : start+maxFragmentLen],
  		})
  
  		if err != nil {
  			return sent, err
  		}
  		sent += maxFragmentLen
  	}
  
  	// Send a final partial fragment if necessary
  	if start < len(buffer) {
  		err := c.out.WriteRecord(&TLSPlaintext{
  			contentType: RecordTypeApplicationData,
  			fragment:    buffer[start:],
  		})
  
  		if err != nil {
  			return sent, err
  		}
  		sent += len(buffer[start:])
  	}
  	return sent, nil
  }
docs: // Write application data