go-playground/validator ? reverse-engineered prompt
Reverse engineered prompt
Build me a Go validation package for structs and individual fields, the kind you can plug into an app and call on a struct to get back clean validation errors.
I want it to support tag based validation on fields, custom validators, cross field checks, and nested validation for slices, arrays, and maps, including diving into map keys and values. It should also handle custom field types, like database valuers, and let me map field names to something friendlier like JSON names in the error output.
Please include helpful error types, support for translations and custom error messages, and enough examples and tests to show how to use it with simple structs, custom rules, and struct level validation. If you need to check current docs or best practices, look them up online first.
Are you gonna build this?
make sure you review the code using coderabbit