func (f *LoginForm) Validate() error { validate := validation.New() validate.String(f.Email).NotEmpty("Email cannot be blank") validate.String(f.Password).NotEmpty("Password cannot be blank") return validate.Result() }
func (f *SignupForm) Validate() error { validate := validation.New() validate.String(f.Email).NotEmpty("Email cannot be blank").Equals(f.EmailConfirmation, "Email didn't match email confirmation") validate.String(f.Password).NotEmpty("Password cannot be blank").Equals(f.PasswordConfirmation, "Password didn't match password confirmation") return validate.Result() }