1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

fmt: fix some gofmt issue

This commit is contained in:
dudaodong
2021-11-29 13:01:46 +08:00
parent 4848647918
commit 0c4b512084
14 changed files with 46 additions and 44 deletions

View File

@@ -123,9 +123,9 @@ func IsChinesePhone(phone string) bool {
// IsCreditCard check if the string is credit card.
func IsCreditCard(creditCart string) bool {
pattern := `^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$`
reg := regexp.MustCompile(pattern)
return reg.MatchString(creditCart)
pattern := `^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$`
reg := regexp.MustCompile(pattern)
return reg.MatchString(creditCart)
}
// IsBase64 check if the string is base64 string.
@@ -191,4 +191,3 @@ func IsWeakPassword(password string) bool {
return (num || letter) && !special
}