govalidator
Go package of validators and sanitizers for strings, structs and collections.
asaskevich.dev/projects/govalidator/repositorydocs
govalidator is a Go package with validators and sanitizers for strings, structs and collections. Struct fields are checked through valid struct tags, where each validator name in a tag maps to a function, and the same checks are available as plain functions for values outside a struct.
The README says the package is based on validator.js, the JavaScript validation library. Custom validators can be added to the tag map, and a struct can be required to tag every field.
Worth knowing
The README’s breaking-changes section says custom validator functions take a context as second parameter, and that custom validators are added through a method rather than by writing to the map, to prevent data races.
Identity
- Status
- Active
- Maintainer
- Aliaksei (Alex) Saskevich4
- Maintained by
- Individual
- First release
- 20145
Rendering and deploy
- Install with
- go get3
Releases
Adoption
Sources
- 2026-11-09: links, Written in, License, GitHub stars
api.github.com/repos/asaskevich/govalidator - 2026-11-09: links
asaskevich.dev/projects/govalidator/ - 2026-11-09: links, Categories, Runtime, Install with
raw.githubusercontent.com/asaskevich/govalidator/master/README.md - 2026-11-09: License model, Maintainer
raw.githubusercontent.com/asaskevich/govalidator/master/LICENSE - 2026-11-09: First release
api.github.com/repos/asaskevich/govalidator/commits/6fa0de0bdbbf76d3460145dc92622df8ecdc2f41 - 2026-11-09: Current major version, Last release
proxy.golang.org/github.com/asaskevich/govalidator/v12/@v/v12.0.0.info - 2026-11-09: Contributors
api.github.com/repos/asaskevich/govalidator/contributors?per_page=1