File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ type (
2626 emailField string ,
2727 email string ,
2828 validations * govalidatormappervalidation.StructValidations ,
29- ) error
29+ )
3030 Birthdate (
3131 birthdateField string ,
3232 birthdate * time.Time ,
3333 validations * govalidatormappervalidation.StructValidations ,
34- ) error
34+ )
3535 CreateValidateFn (
3636 mapper * govalidatormapper.Mapper ,
3737 auxiliaryValidatorFns ... interface {},
@@ -101,29 +101,27 @@ func (d *DefaultService) Email(
101101 emailField string ,
102102 email string ,
103103 validations * govalidatormappervalidation.StructValidations ,
104- ) error {
104+ ) {
105105 if _ , err := govalidatorfieldmail .ValidMailAddress (email ); err != nil {
106106 validations .AddFieldValidationError (
107107 emailField ,
108108 govalidatorfieldmail .ErrInvalidMailAddress ,
109109 )
110110 }
111- return nil
112111}
113112
114113// Birthdate validates the birthdate field
115114func (d * DefaultService ) Birthdate (
116115 birthdateField string ,
117116 birthdate * time.Time ,
118117 validations * govalidatormappervalidation.StructValidations ,
119- ) error {
118+ ) {
120119 if birthdate == nil || birthdate .After (time .Now ()) {
121120 validations .AddFieldValidationError (
122121 birthdateField ,
123122 govalidatorfieldbirthdate .ErrInvalidBirthdate ,
124123 )
125124 }
126- return nil
127125}
128126
129127// CreateValidateFn creates a validate function for the request body using the validator
You can’t perform that action at this time.
0 commit comments