Skip to content

Cookbook

This content is for v0.7. Switch to the latest version for up-to-date documentation.

Use these pages as templates. Each recipe is designed to be copied into your project and adapted.

  • Sign-up Form: validate multiple fields with friendly output.
  • Nested Structs: namespaces for nested models.
  • Slices & Indexed Errors: validate lists with InRow / InCell.
  • Optional Fields (Pointers): nil-aware rules.
  • Conditional Rules: gate rules based on current validity or conditions.
  • Custom Messages: override templates per rule.
  • Localization: swap locales or override entries.
  • Reusable Validations: compose with Merge and helper functions.