Redact masks the given token by replacing part of the string with *
(token string)
| 90 | |
| 91 | // Redact masks the given token by replacing part of the string with * |
| 92 | func Redact(token string) string { |
| 93 | str := token[4 : len(token)-3] |
| 94 | redaction := strings.Repeat("*", len(str)) |
| 95 | return string(token[:4]) + redaction + string(token[len(token)-3:]) |
| 96 | } |
no outgoing calls