Skip to content

Commit

Permalink
Go critic identified issues. Fixes #82 (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
cinar committed Jun 22, 2023
1 parent 622fa89 commit db8ce0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions email.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ResultNotEmail = "NOT_EMAIL"
const ipV6Prefix = "[IPv6:"

// notQuotedChars is the valid not quoted characters.
var notQuotedChars = regexp.MustCompile("[a-zA-Z0-9!#$%&'*+-/=?^_`{|}~]")
var notQuotedChars = regexp.MustCompile("[a-zA-Z0-9!#$%&'*\\+\\-/=?^_`{|}~]")

// IsEmail checks if the given string is an email address.
func IsEmail(email string) Result {
Expand All @@ -33,7 +33,7 @@ func IsEmail(email string) Result {
user := email[:atIndex]

// Cannot be empty user
if len(user) == 0 || len(user) > 64 {
if user == "" || len(user) > 64 {
return ResultNotEmail
}

Expand Down
2 changes: 1 addition & 1 deletion fqdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const CheckerFqdn = "fqdn"
const ResultNotFqdn = "NOT_FQDN"

// Valid characters excluding full-width characters.
var fqdnValidChars = regexp.MustCompile("^[a-z0-9\u00a1-\uff00\uff06-\uffff-]+$")
var fqdnValidChars = regexp.MustCompile("^[a-z0-9\u00a1-\uff00\uff06-\uffff\\-]+$")

// IsFqdn checks if the given string is a fully qualified domain name.
func IsFqdn(domain string) Result {
Expand Down

0 comments on commit db8ce0e

Please sign in to comment.