This project is a simple system for validating user inputs in Go. It allows you to define rules for fields and validate that data meets certain conditions. It provides easy-to-understand error messages for invalid inputs.
This project is currently in development, and additional features will be added soon, including more validation rules and improved error handling. Future updates may include support for more complex validation scenarios, extended field types, and greater flexibility in customization.
Stay tuned for upcoming enhancements!
Tag | Description |
---|---|
boolean | Boolean |
contains | Contains |
notcontains | not Contains |
numeric | Numeric |
Tag | Description |
---|---|
ip | Internet Protocol Address IP |
ipv4 | Internet Protocol Address IPv4 |
ipv6 | Internet Protocol Address IPv6 |
mac | Media Access Control Address MAC |
uri | URI String |
url | URL String |
Tag | Description |
---|---|
required | Required |
optional | Optional |
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
}
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.
- Add Unit tests.