A package of validators and sanitizers for strings, structs and collections. Based on validator.js. Activate behavior to require all fields have a validation tag by default. SetFieldsRequiredByDefault causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using valid:"-" or valid:"email,optional"). A good place to activate this is a package init function or the main() function. SetNilPtrAllowedByRequired causes validation to pass when struct fields marked by required are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between nil and zero value state can use this. If disabled, both nil and zero values cause validation errors. If you want to validate structs, you can use tag valid for any field in your structure. All validators used with this field in one tag are separated by comma.

Features

  • Custom validator function signature
  • Add custom validators
  • Completely custom validators
  • Validate maps
  • Custom validation using your own domain specific validators
  • Custom error messages are supported

Project Samples

Project Activity

See All Activity >

Categories

Package Managers

License

MIT License

Follow govalidator

govalidator Web Site

Other Useful Business Software
Orchestrate Your AI Agents with Zenflow Icon
Orchestrate Your AI Agents with Zenflow

The multi-agent workflow engine for modern teams. Zenflow executes coding, testing, and verification with deep repo awareness

Zenflow orchestrates AI agents like a real engineering system. With parallel execution, spec-driven workflows, and deep multi-repo understanding, agents plan, implement, test, and verify end-to-end. Upgrade to AI workflows that work the way your team does.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of govalidator!

Additional Project Details

Programming Language

Go

Related Categories

Go Package Managers

Registered

2021-11-23