fix(lint): update some warning from golangci-lint

https://github.com/appleboy/gorush/issues/704

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu
2022-12-18 10:06:43 +08:00
parent 577083639c
commit 83a6e63af9
10 changed files with 35 additions and 22 deletions

View File

@@ -153,8 +153,8 @@ func hideToken(token string, markLen int) string {
start := token[len(token)-markLen:]
end := token[0:markLen]
result := strings.Replace(token, start, strings.Repeat("*", markLen), -1)
result = strings.Replace(result, end, strings.Repeat("*", markLen), -1)
result := strings.ReplaceAll(token, start, strings.Repeat("*", markLen))
result = strings.ReplaceAll(result, end, strings.Repeat("*", markLen))
return result
}