Skip to content

Commit

Permalink
handled nil map issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbeelghouri committed Jun 14, 2024
1 parent 2d6a4e8 commit 40ae9b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions validators/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ func LoadValidator() *Validators {
}

func (v *Validators) RegisterValidator(name string, fn Validator) {
if v.ValidationFns == nil {
v.ValidationFns = make(map[string]Validator)
}
v.ValidationFns[name] = fn
}

Expand Down

0 comments on commit 40ae9b8

Please sign in to comment.