Skip to content

Commit 82b9290

Browse files
committed
feat: add description in withearlyexit option
1 parent b43b1a1 commit 82b9290

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

options.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ func WithPrivateFieldValidation() Option {
2525
}
2626
}
2727

28-
// WithEarlyExit
28+
// WithEarlyExit configures the validator to immediately stop validation as soon as the first error is encountered
29+
//
30+
// This feature could be an opt-in behavior, allowing to opt into "early exit" validation, without breaking current workflows
31+
// Early exit on the first failure would save time by avoiding unnecessary checks on the remaining fields
2932
func WithEarlyExit() Option {
3033
return func(v *Validate) {
3134
v.earlyExit = true

0 commit comments

Comments
 (0)