Merge pull request #358 from Ashtonian/patch-1

add missing `Engine()` to default validator for gin override example
pull/362/head
Dean Karn 7 years ago committed by GitHub
commit f459c64611
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      _examples/gin-upgrading-overriding/v8_to_v9.go

@ -29,6 +29,11 @@ func (v *defaultValidator) ValidateStruct(obj interface{}) error {
return nil
}
func (v *defaultValidator) Engine() interface{} {
v.lazyinit()
return v.validate
}
func (v *defaultValidator) lazyinit() {
v.once.Do(func() {
v.validate = validator.New()

Loading…
Cancel
Save