Skip to content

Commit

Permalink
Edit README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
debug-ing committed Nov 16, 2024
1 parent 38b31af commit 2963a9b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ Stay tuned for upcoming enhancements!
| required | Required |
| optional | Optional |

## Add Custom Validator:

```go
validation.AddCustomValidator("test", "%s vard kon", validateRequired)

func validateRequired(value string, errorMsg string) error {
if value == "" {
fmt.Println(errorMsg)
return errors.New(errorMsg)
}
return nil
}


```



## more

I developed this project to deepen my understanding of Go and its capabilities. It's an opportunity for me to explore Go's features and enhance my skills in building more efficient and flexible systems.
Expand Down
1 change: 0 additions & 1 deletion pkg/validation/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ func AddCustomValidator(tagName, message string, fn interface{}) {
data[tagName] = map[string]string{
"error_msg": message,
}
fmt.Println(data)
}

func getMessage(tagName, fieldName string, args ...interface{}) string {
Expand Down

0 comments on commit 2963a9b

Please sign in to comment.