Fixed linter errors

This commit is contained in:
2019-10-21 14:02:09 +09:00
parent 1819367160
commit 506fd3c0a7
6 changed files with 45 additions and 43 deletions

View File

@ -22,6 +22,7 @@ const (
var (
discordNickRegex = regexp.MustCompile(`^([^#]{2,32})#(\d{4})$`)
emailRegex = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
)
// Nick tests if the given nickname is valid.
@ -70,8 +71,7 @@ func YearMonth(date string) bool {
// Email tests if the given email address is valid.
func Email(email string) bool {
// TODO: Add email check
return email != ""
return emailRegex.MatchString(email)
}
// URI validates a URI.