let mask ke shows head and tail

This commit is contained in:
c9s 2021-12-29 15:25:31 +08:00
parent 542380efdf
commit 6440c7659b

View File

@ -14,5 +14,7 @@ func StringSliceContains(slice []string, needle string) bool {
func MaskKey(key string) string {
maskKey := key[0:5]
return maskKey + strings.Repeat("*", len(key)-1-5)
maskKey += strings.Repeat("*", len(key)-1-5-5)
maskKey += key[len(key)-5-1:]
return maskKey
}