MCPcopy Index your code
hub / github.com/tbphp/gpt-load / RedactSecret

Function RedactSecret

internal/utils/string_utils.go:18–23  ·  view source on GitHub ↗

RedactSecret replaces every occurrence of secret in text with its masked form.

(text, secret string)

Source from the content-addressed store, hash-verified

16
17// RedactSecret replaces every occurrence of secret in text with its masked form.
18func RedactSecret(text, secret string) string {
19 if secret == "" {
20 return text
21 }
22 return strings.ReplaceAll(text, secret, MaskAPIKey(secret))
23}
24
25// TruncateString shortens a string to a maximum length.
26func TruncateString(s string, maxLength int) string {

Callers 5

TestRedactSecretFunction · 0.85

Calls 1

MaskAPIKeyFunction · 0.85

Tested by 4

TestRedactSecretFunction · 0.68