diff --git a/between.go b/between.go index 3568ebd..a941d92 100644 --- a/between.go +++ b/between.go @@ -1,9 +1,9 @@ package validator const ( - // Between represents the rule name which will be used to find the default error message. + // Between represents rule name which will be used to find the default error message. Between = "between" - // BetweenMsg is the default error message format for between rule. + // BetweenMsg is the default error message format for fields with Between rule. BetweenMsg = "%s should be greater than or equal %v and less than or equal %v" ) diff --git a/date.go b/date.go index dbd60a3..387341d 100644 --- a/date.go +++ b/date.go @@ -5,9 +5,9 @@ import ( ) const ( - // Date represents the rule name which will be used to find the default error message. + // Date represents rule name which will be used to find the default error message. Date = "date" - // DateMsg is the default error message format for fields with the Date validation rule. + // DateMsg is the default error message format for fields with Date validation rule. DateMsg = "%s has wrong date format" ) diff --git a/email.go b/email.go index e95c1c3..e016e6f 100644 --- a/email.go +++ b/email.go @@ -1,9 +1,9 @@ package validator const ( - // Email represents the rule name which will be used to find the default error message. + // Email represents rule name which will be used to find the default error message. Email = "email" - // EmailMsg is the default error message format for fields with the email validation rule. + // EmailMsg is the default error message format for fields with Email validation rule. EmailMsg = "%s is not valid" // EmailRegex is the default pattern to validate email field by RFC 5322 rule. EmailRegex = "(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\\])" diff --git a/exists.go b/exists.go index d549e1a..d6ffba9 100644 --- a/exists.go +++ b/exists.go @@ -1,9 +1,9 @@ package validator const ( - // Exists represents the rule name which will be used to find the default error message. + // Exists represents rule name which will be used to find the default error message. Exists = "exists" - // ExistsMsg is default error message format for records that does not exist. + // ExistsMsg is default error message format for fields with Exists validation rule. ExistsMsg = "%s does not exist" ) diff --git a/len.go b/len.go index 01bcc34..a28b02f 100644 --- a/len.go +++ b/len.go @@ -6,13 +6,13 @@ import ( ) const ( - // Len represents the rule name which will be used to find the default error message. + // Len represents rule name which will be used to find the default error message. Len = "len" - // LenList represents the rule name which will be used to find the default error message. + // LenList represents rule name which will be used to find the default error message. LenList = "lenList" - // LenMsg is the default error message format for Len validation rule. + // LenMsg is the default error message format for fields with Len validation rule. LenMsg = "%s should be %d characters" - // LenListMsg is the default error message format for LenSlice validation rule. + // LenListMsg is the default error message format for fields with LenList validation rule. LenListMsg = "%s should have %d items" ) diff --git a/max.go b/max.go index 910e89f..1d53ffe 100644 --- a/max.go +++ b/max.go @@ -3,13 +3,13 @@ package validator import "strings" const ( - // Max represents the rule name which will be used to find the default error message. + // Max represents rule name which will be used to find the default error message. Max = "max" - // MaxString represents the rule name which will be used to find the default error message. + // MaxString represents rule name which will be used to find the default error message. MaxString = "maxString" - // MaxMsg is the default error message format for fields with the maximum validation rule. + // MaxMsg is the default error message format for fields with Max validation rule. MaxMsg = "%s should be less than %v" - // MaxStringMsg is the default error message format for fields with the MaxString validation rule. + // MaxStringMsg is the default error message format for fields with MaxString validation rule. MaxStringMsg = "%s should has less than %v characters" ) diff --git a/min.go b/min.go index fe461bd..ecbed60 100644 --- a/min.go +++ b/min.go @@ -3,13 +3,13 @@ package validator import "strings" const ( - // Min represents the rule name which will be used to find the default error message. + // Min represents rule name which will be used to find the default error message. Min = "min" // MinString represents the rule name which will be used to find the default error message. MinString = "minString" - // MinMsg is the default error message format for fields with the minimum validation rule. + // MinMsg is the default error message format for fields with Min validation rule. MinMsg = "%s should be more than %v" - // MinStringMsg is the default error message format for fields with the MinString validation rule. + // MinStringMsg is the default error message format for fields with MinString validation rule. MinStringMsg = "%s should has more than %v characters" ) diff --git a/notexists.go b/notexists.go index 4f17a6d..50c432b 100644 --- a/notexists.go +++ b/notexists.go @@ -1,10 +1,10 @@ package validator const ( - // NotExists represents the rule name which will be used to find the default error message. + // NotExists represents rule name which will be used to find the default error message. NotExists = "notExists" - // NotExistsMsg is default error message format for records that don't exist. + // NotExistsMsg is default error message format for fields with with NotExists validation rule. NotExistsMsg = "%s already exists" ) diff --git a/regex.go b/regex.go index e9b5a78..4e34c82 100644 --- a/regex.go +++ b/regex.go @@ -3,9 +3,9 @@ package validator import "regexp" const ( - // Regex represents the rule name which will be used to find the default error message. + // Regex represents rule name which will be used to find the default error message. Regex = "regex" - // RegexMsg is the default error message format for fields with the regex validation rule. + // RegexMsg is the default error message format for fields with the Regex validation rule. RegexMsg = "%s is not valid" ) diff --git a/required.go b/required.go index efb3f02..3a1a3af 100644 --- a/required.go +++ b/required.go @@ -3,9 +3,9 @@ package validator import "strings" const ( - // Required represents the rule name which will be used to find the default error message. + // Required represents rule name which will be used to find the default error message. Required = "required" - // RequiredMsg is the default error message format for required fields. + // RequiredMsg is the default error message format for fields with required validation rule. RequiredMsg = "%s is required" ) diff --git a/uuid.go b/uuid.go index 155a913..0d090ac 100644 --- a/uuid.go +++ b/uuid.go @@ -3,7 +3,7 @@ package validator import "github.com/google/uuid" const ( - // UUID represents the rule name which will be used to find the default error message. + // UUID represents rule name which will be used to find the default error message. UUID = "uuid" // UUIDMsg is the default error message format for fields with the UUID validation rule. UUIDMsg = "%s is not a valid UUID"