Skip to content

Commit bdf538f

Browse files
committed
src: validator: rename arguments in configure func
Signed-off-by: Dmitrii Aleksandrov <goodmobiledevices@gmail.com>
1 parent 9cd7453 commit bdf538f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

validator.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ func New(opts ...Option) *Validator {
6161
// It creates a new instance of type T, allocates values for all fields recursively,
6262
// creates a Configurator instance for the type T, calls the provided function fn with the Configurator
6363
// instance and the instance of type T, and appends any user-defined validators to the Configurator instance.
64-
func Configure[T any](v *Validator, fn func(builder Configurator[T], obj *T)) {
65-
obj := new(T)
64+
func Configure[T any](v *Validator, fn func(builder Configurator[T], m *T)) {
65+
model := new(T)
6666
// allocate all pointer fields values recursively
67-
mustZero(obj)
68-
b := configure[T](v, obj, nil)
67+
mustZero(model)
68+
b := configure[T](v, model, nil)
6969
// Append users validators
70-
fn(b, obj)
70+
fn(b, model)
7171
}

0 commit comments

Comments
 (0)