Skip to content

Commit

Permalink
Merge f8e9eea into 65ad70c
Browse files Browse the repository at this point in the history
  • Loading branch information
look committed Jul 29, 2022
2 parents 65ad70c + f8e9eea commit e567532
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions argument.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,11 @@ func (o *arg) parse(args []string, argCount int) error {
return fmt.Errorf("[%s] can only be present once", o.name())
}

// If validation function provided -- execute, on error return it immediately
// If validation function provided -- execute, on error return immediately
if o.opts != nil && o.opts.Validate != nil {
err := o.opts.Validate(args)
if err != nil {
return err
return fmt.Errorf("[%s] %w", o.name(), err)
}
}
return o.parseSomeType(args, argCount)
Expand Down

0 comments on commit e567532

Please sign in to comment.