go-playground/validator

:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 9 minutes ago
Added to GitGenius on September 2nd, 2026
Created on February 12th, 2015
Open Issues & Pull Requests: 326 (+1)
GitHub issues: Enabled
Number of forks: 1,452
Total Stargazers: 20,145 (+0)
Total Subscribers: 124 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Issue API getrepoissuespagesummary failed: 429 Rate limit exceeded. Please try again later.

Detailed Description

Validator is a Go struct and field validation library that enforces constraints through tags.

The tool solves the problem of validating Go structs and their fields by implementing a tag-based validation system. It works by reading validation tags on struct fields and applying corresponding checks, returning structured error information when validation fails. Beyond basic field validation, it supports cross-field and cross-struct validations, allowing you to express constraints that depend on multiple fields or nested structures. It can dive into slices, arrays, and maps at any nesting level, validating elements within collections. The library handles interface types by inspecting their underlying concrete type before validation, and it supports custom field types including those implementing the sql driver Valuer interface. You can define alias tags to map multiple validations to a single tag name, reducing repetition in struct definitions. Error messages are customizable and support internationalization, and the tool can extract custom field names like JSON tags for use in error reporting.

Adopt this tool if you need declarative validation for Go structs with minimal boilerplate. It suits projects that validate user input, API requests, or configuration data and benefit from expressing validation rules close to the data structures themselves. The library is the default validator for the Gin web framework, making it a natural choice if you use that framework.

The project maintains active development with regular updates and demonstrates sustained engagement with its user base. The maintainers have explicitly opened discussion about expanding the maintenance team, indicating transparency about the project's needs and future direction.