An idiomatic Go (golang) validation package. Supports configurable and extensible validation rules (validators) using normal language constructs instead of error-prone struct tags.
If for instance the Length rule failed, I will have an object of type validation.Errors which is basically a map[string]error.
Of course it is fine, but is there any way to have something more structured ?
For instance could we have / imagine something map[string]ValidationError with the definition of ValidationError like this ?
Hi everyone,
I'm actually wondering if there is any way with go-ozzo to have some details on errors but in a more structured way ? Let me explain:
Let say I have the following code and an input like this with some validation
If for instance the Length rule failed, I will have an object of type
validation.Errors
which is basically a map[string]error. Of course it is fine, but is there any way to have something more structured ?For instance could we have / imagine something map[string]ValidationError with the definition of ValidationError like this ?
Which can be easier to use / analyse that a simple string ?
As an example:
What we have now (json way)
What I would like :) (json way)
This is a total opened topic of course, all advices are really welcomed :+1: