code: func ClipMessage(text string, length int) string {
  	const clippingMessage = " <clipped message>"
  	if len(text) > length {
  		text = text[:length-len(clippingMessage)]
  		if r, size := utf8.DecodeLastRuneInString(text); r == utf8.RuneError {
  			text = text[:len(text)-size]
  		}
  		text += clippingMessage
  	}
  	return text
  }
docs: // ClipMessage trims a message to the specified length if it exceeds it and adds a warning
  // to the message in case it does so.