MCPcopy Create free account
hub / github.com/bytebase/bytebase / TruncateStringWithDescription

Function TruncateStringWithDescription

backend/common/util.go:90–96  ·  view source on GitHub ↗

TruncateStringWithDescription tries to truncate the string and append "... (view details in Bytebase)" if truncated.

(str string)

Source from the content-addressed store, hash-verified

88
89// TruncateStringWithDescription tries to truncate the string and append "... (view details in Bytebase)" if truncated.
90func 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.
99func Obfuscate(src, seed string) string {

Callers 4

GetMetaListMethod · 0.92
GetMetaListZhMethod · 0.92
BuildMessageFunction · 0.92
BuildMessageFunction · 0.92

Calls 1

TruncateStringFunction · 0.85

Tested by

no test coverage detected