code: func truncateString(s string, length int) string {
  	if len(s) <= length {
  		return s
  	}
  
  	// UTF-8 continuation bytes start with 10xx xxxx:
  	// 0xc0 = 1100 0000
  	// 0x80 = 1000 0000
  	cutoff := length
  	for s[cutoff]&0xc0 == 0x80 {
  		cutoff--
  		if cutoff < 0 {
  			cutoff = 0
  			break
  		}
  	}
  
  	return s[0:cutoff]
  }
docs: // truncateString truncates s to a maximum of length bytes without breaking UTF-8 codepoints.