Skip to content

Conversation

@DaniilDaedalus
Copy link

Simple multiple arguments Require(). Not sure if RequireAll must return *ValidationResult. RequireAll() might also replace Require() without breaking compatibility.

func (v *Validator) RequireAll(fields ...string) {
for _, field := range fields {
v.Require(field)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like we would want to have a return value for this since Require has one... would it make sense to have this signature be:

func (v *Validator) RequireAll(fields ...string) ([]*ValidationResult, bool) {
  // ...
}

where the boolean return value indicates validity of the set, while the slice would provide access to the results?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants