Skip to content

Commit

Permalink
Merge pull request go-playground#358 from Ashtonian/patch-1
Browse files Browse the repository at this point in the history
add missing `Engine()` to default validator for gin override example
  • Loading branch information
fairyhunter13 committed May 5, 2018
2 parents e3c58da + fe7e89e commit d31179a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions _examples/gin-upgrading-overriding/v8_to_v9.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d31179a

Please sign in to comment.