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
AI-powered service management for IT and enterprise teams Icon
AI-powered service management for IT and enterprise teams

Enterprise-grade ITSM, for every business

Give your IT, operations, and business teams the ability to deliver exceptional services—without the complexity. Maximize operational efficiency with refreshingly simple, AI-powered Freshservice.
Try it Free
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