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

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
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