diff --git a/pkg/validators/currency.go b/pkg/validators/currency.go index 79cb2d6b..677b9c9f 100644 --- a/pkg/validators/currency.go +++ b/pkg/validators/currency.go @@ -168,6 +168,7 @@ var allCurrencyNames = map[string]bool{ "ZWL": true, //Zimbabwe Dollar } +// ValidCurrency returns whether the given currency is valid func ValidCurrency(fl validator.FieldLevel) bool { if value, ok := fl.Field().Interface().(string); ok { if value == ParentAccountCurrencyPlaceholder { diff --git a/pkg/validators/email.go b/pkg/validators/email.go index a3987b29..43c11c2e 100644 --- a/pkg/validators/email.go +++ b/pkg/validators/email.go @@ -6,6 +6,7 @@ import ( "github.com/mayswind/lab/pkg/utils" ) +// ValidEmail returns whether the given email is valid func ValidEmail(fl validator.FieldLevel) bool { if value, ok := fl.Field().Interface().(string); ok { if utils.IsValidEmail(value) { diff --git a/pkg/validators/hex_rgb_color.go b/pkg/validators/hex_rgb_color.go index 89bb6a43..90a25d1b 100644 --- a/pkg/validators/hex_rgb_color.go +++ b/pkg/validators/hex_rgb_color.go @@ -6,6 +6,7 @@ import ( "github.com/mayswind/lab/pkg/utils" ) +// ValidHexRGBColor returns whether the given hex reb color is valid func ValidHexRGBColor(fl validator.FieldLevel) bool { if value, ok := fl.Field().Interface().(string); ok { if utils.IsValidHexRGBColor(value) { diff --git a/pkg/validators/not_blank.go b/pkg/validators/not_blank.go index faef54f7..9ebed708 100644 --- a/pkg/validators/not_blank.go +++ b/pkg/validators/not_blank.go @@ -6,6 +6,7 @@ import ( "github.com/go-playground/validator/v10" ) +// NotBlank returns whether the given content is not blank func NotBlank(fl validator.FieldLevel) bool { if value, ok := fl.Field().Interface().(string); ok { if value != "" && strings.Trim(value, " ") != "" { diff --git a/pkg/validators/username.go b/pkg/validators/username.go index c70f4e48..729f165e 100644 --- a/pkg/validators/username.go +++ b/pkg/validators/username.go @@ -6,6 +6,7 @@ import ( "github.com/mayswind/lab/pkg/utils" ) +// ValidUsername returns whether the given user name is valid func ValidUsername(fl validator.FieldLevel) bool { if value, ok := fl.Field().Interface().(string); ok { if utils.IsValidUsername(value) {