diff --git a/cache.go b/cache.go index 7b84c91..4dea78f 100644 --- a/cache.go +++ b/cache.go @@ -289,7 +289,7 @@ func (v *Validate) parseFieldTagsRecursive(tag string, fieldName string, alias s if wrapper, ok := v.validations[current.tag]; ok { current.fn = wrapper.fn - current.runValidationWhenNil = wrapper.runValidatinOnNil + current.runValidationWhenNil = wrapper.runValidationOnNil } else { panic(strings.TrimSpace(fmt.Sprintf(undefinedValidation, current.tag, fieldName))) } diff --git a/validator_instance.go b/validator_instance.go index 9493da4..3658afd 100644 --- a/validator_instance.go +++ b/validator_instance.go @@ -70,8 +70,8 @@ type CustomTypeFunc func(field reflect.Value) interface{} type TagNameFunc func(field reflect.StructField) string type internalValidationFuncWrapper struct { - fn FuncCtx - runValidatinOnNil bool + fn FuncCtx + runValidationOnNil bool } // Validate contains the validator settings and cache @@ -235,7 +235,7 @@ func (v *Validate) registerValidation(tag string, fn FuncCtx, bakedIn bool, nilC if !bakedIn && (ok || strings.ContainsAny(tag, restrictedTagChars)) { panic(fmt.Sprintf(restrictedTagErr, tag)) } - v.validations[tag] = internalValidationFuncWrapper{fn: fn, runValidatinOnNil: nilCheckable} + v.validations[tag] = internalValidationFuncWrapper{fn: fn, runValidationOnNil: nilCheckable} return nil }