Checker: A Zero-Dependency Go Library for Declarative Struct Validation
A Go library called Checker has been released to simplify input validation by replacing verbose if-statement chains with struct tag declarations. Developers can define rules such as required fields, email format checks, minimum password length, and cross-field comparisons directly alongside struct fields. Unlike many validation libraries, Checker also includes normalizers — such as trim, title-case, and HTML escaping — that run in the same pipeline as validation rules. The library has no external dependencies beyond the Go standard library, reducing supply-chain risk and keeping build times lean. It also supports nested structs, container-level rules for slices and maps, conditional field requirements, and 23 built-in translated locales for error messages.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in