TruncateStringWithDescription tries to truncate the string and append "... (view details in Bytebase)" if truncated.
(str string)
| 88 | |
| 89 | // TruncateStringWithDescription tries to truncate the string and append "... (view details in Bytebase)" if truncated. |
| 90 | func TruncateStringWithDescription(str string) string { |
| 91 | const limit = 450 |
| 92 | if truncatedStr, truncated := TruncateString(str, limit); truncated { |
| 93 | return fmt.Sprintf("%s... (view details in Bytebase)", truncatedStr) |
| 94 | } |
| 95 | return str |
| 96 | } |
| 97 | |
| 98 | // Obfuscate obfuscates a string with a seed string. |
| 99 | func Obfuscate(src, seed string) string { |
no test coverage detected