data validation for #golang with configurable & extensible rules in usual code constructs

ozzo-validation is a Go package that provides configurable and extensible data validation capabilities. It uses programming constructs to specify how data should be validated rather than relying on error-prone struct tags, which makes your code more flexible and less error prone. ozzo-validation has the following features:

  • rule-based data validation that allows validating a data value with multiple rules.
  • validation rules are declared via normal programming constructs instead of error-prone struct tags.
  • can validate data of different types, e.g., structs, strings, byte slices, slices, maps, arrays.
  • can validate custom data types as long as they implement the Validatable interface.
  • support validating data types that implement the sql.Valuer interface (e.g. sql.NullString).
  • support validating selective struct fields.
  • customizable and well-formatted validation errors.
  • provide a rich set of validation rules right out of box.
  • extremely easy to create and use custom validation rules.

https://github.com/go-ozzo/ozzo-validation

Share This: