A Go package providing validators and sanitizers for strings, numerics, slices, and structs.
Govalidator is a Go library that provides a comprehensive set of validators and sanitizers for strings, numbers, slices, and structs. It solves the problem of ensuring data correctness and security in Go applications by offering built-in validation for common formats (like emails, URLs, IPs) and extensible custom validation rules.
Go developers building web services, APIs, or any backend application that requires robust input validation and data sanitization.
Developers choose Govalidator for its extensive built-in validators, easy struct and map validation via tags, and flexibility to add custom rules, making it a one-stop solution for data validation in Go projects.
[Go] Package of validators and sanitizers for strings, numerics, slices and structs
Includes validators for emails, URLs, IPs, UUIDs, credit cards, and many common formats, reducing the need for custom code.
Uses struct tags to define validation rules, making it easy to annotate fields with requirements like 'required' or 'email'.
Supports adding custom validators with parameterized tags and context-aware functions for domain-specific logic.
Provides functions like WhiteList and BlackList for cleaning strings, plus trimming and normalization operations.
The README's TODO list admits missing validators like IsFQDN and IsIMEI, requiring custom work for some formats.
Recent updates changed custom validator signatures and registration methods, causing migration issues for existing code.
Relies on reflection and runtime tag evaluation, which can impact performance and lacks compile-time safety.
:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
An idiomatic Go (golang) validation package. Supports configurable and extensible validation rules (validators) using normal language constructs instead of error-prone struct tags.
Validate Golang request data with simple rules. Highly inspired by Laravel's request validation.
Go with Zod inspired simple schema validation
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.