Skip to content

Commit

Permalink
feat: improve error empty message
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkabwe committed May 12, 2024
1 parent 8ab060b commit 7b4af39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (v *validator) handleStructValidation(input []string, fieldName string, fie
switch field {
case "required":
if fieldValue == "" {
v.errors = errorMap{fieldName: ErrEmptyField}
v.errors = errorMap{fieldName: fmt.Errorf("%s is required", fieldName)}
}
case "int":
if ok, err := v.isInt(fieldValue); !ok {
Expand Down

0 comments on commit 7b4af39

Please sign in to comment.