For a data validation library for Go, the strongest matches are go-playground/validator (This library is the industry-standard tool for Go struct), go-ozzo/ozzo-validation (This library provides a robust, interface-based approach to validating) and go-validator/validator (This library is the standard Go framework for struct-based). asaskevich/govalidator and thedevsaddam/govalidator round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
We curate open-source GitHub repositories matching “best go validation libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
This is a Go struct validation library used to maintain data integrity by enforcing constraints on fields, slices, and maps. It functions as a schema validation tool and data integrity validator, ensuring that complex nested structures adhere to predefined rules. The library utilizes struct tags to configure validation logic at runtime and supports a custom function registry for extending validation rules. It is distinguished by its ability to perform cross-field dependency evaluation, allowing the comparison of values between different fields within the same data structure to ensure logical
This library is the industry-standard tool for Go struct validation, offering comprehensive support for struct tags, custom rules, cross-field dependencies, and nested validation.
ozzo-validation is a programmable data validation library for Go that verifies structs, maps, and primitive types using a declarative, rule-based approach. It functions as an interface-based validator, allowing for the recursive checking of nested data structures and custom types without the use of struct tags. The framework distinguishes itself as a context-aware validation engine, supporting the propagation of request-scoped data to rules that depend on external state. It provides extensive extensibility through custom rule definitions and the ability to override default failure text with l
This library provides a robust, interface-based approach to validating Go structs and nested data structures, offering extensive support for custom rules and complex validation logic without relying on struct tags.
This project is a data validation framework for the Go programming language that enforces integrity by applying declarative constraints to struct fields. It utilizes reflection to inspect data structures at runtime, mapping field-level requirements defined in struct tags to specific validation logic. The library distinguishes itself through its ability to handle complex object graphs by recursively traversing nested structures and slices. It supports context-aware validation, allowing developers to switch between different rule sets for the same data structure based on application state or sp
This library is the standard Go framework for struct-based data validation, offering comprehensive support for nested structures, custom rules, and cross-field validation via struct tags.
Go Package of validators and sanitizers for strings, numerics, slices and structs
This library provides a comprehensive suite of struct tag-based validation and sanitization tools for Go, making it a direct fit for validating data structures and user input.
Validate Golang request data with simple rules. Highly inspired by Laravel's request validation.
This library provides a straightforward way to validate Go request data using struct tags and custom rules, making it a solid choice for handling input validation despite lacking some of the more advanced features like complex cross-field validation.
⚔ Go package for data validation and filtering. support Map, Struct, Form data. Go通用的数据验证与过滤库,使用简单,内置大部分常用验证、过滤器,支持自定义验证器、自定义消息、字段翻译。
This library provides comprehensive struct tag validation, custom rule support, and nested validation for Go, making it a direct fit for your data validation needs.
This project is a protocol buffer validation plugin and code generator that creates consistent validation logic across multiple programming languages. It functions as a compiler extension for the Protocol Buffer toolchain, allowing developers to define semantic constraints directly within schema files to ensure data consistency. The tool uses custom options to embed validation rules into message definitions, mapping these schema constraints to language-specific implementation patterns. It employs predicate-based constraint checking and recursive traversal to enforce rules across nested messag
This is a protocol buffer compiler plugin that generates validation code for schemas rather than a general-purpose Go library for validating arbitrary structs or user input.
Fasthttp is a high-performance networking framework for Go, designed to maximize throughput and minimize memory overhead in demanding web applications. It functions as a specialized HTTP server and client library that prioritizes efficient resource management, allowing developers to build scalable services capable of handling massive concurrent traffic with minimal garbage collection pressure. The library distinguishes itself through a focus on zero-allocation processing and low-level optimization. It achieves this by recycling temporary request and response objects through managed pools and
This is a high-performance HTTP framework for building web servers and clients, not a library for validating data structures or user input.
Datree is a policy enforcement framework for Kubernetes that validates configurations against rules written in Rego, JSON Schema, or CEL. It operates as both a command-line tool for pre-deployment scanning and as a cluster-side admission webhook for real-time enforcement, integrating with CI/CD pipelines and continuous delivery tools like ArgoCD and FluxCD. The framework supports namespace-scoped policy mapping, allowing different policies to apply to different namespaces, and provides a skip annotation mechanism for selectively bypassing rules on individual resources or entire namespaces. It
This is a policy enforcement and configuration scanning tool for Kubernetes rather than a general-purpose data validation library for Go applications.