Versions in this module Expand all Collapse all v1 v1.25.0 Jun 14, 2026 Changes in this version + func NotBlank[T ~string](v T) error + func NotEmpty[T any](v []T) error + func Required[T comparable](v T) error + type Field interface + Validate func() (name string, err error) + func Number[T number](name string, value T, rules ...Rule[T]) Field + func OptionalString[T ~string](name string, value *T, rules ...Rule[T]) Field + func Slice[T any](name string, value []T, rules ...Rule[[]T]) Field + func String[T ~string](name string, value T, rules ...Rule[T]) Field + type Problems map[string]string + func Validate(fields ...Field) Problems + func (p Problems) Ok() bool + type Rule func(T) error + func Each[T any](rules ...Rule[T]) Rule[[]T] + func In[T ~string](allowed ...T) Rule[T] + func Match(re *regexp.Regexp, msg string) Rule[string] + func MaxLength(n int) Rule[string] + func Max[T number](n T) Rule[T] + func MinLength(n int) Rule[string] + func Min[T number](n T) Rule[T]