neo7337 / go-struct-validator

Golang Struct Validator
https://pkg.go.dev/github.com/neo7337/go-struct-validator
Apache License 2.0
7 stars 3 forks source link

Why there are Required and nillable separated tags? #13

Closed vitorestevam closed 2 years ago

vitorestevam commented 2 years ago

I readed that both tags are WIP, but i didn't understand why we have two tags with the same meaning and the verification for required is already checking if it's string nil ""

image

I think that less required fields means a cleanner code. Another possible improvement would be set Required as true or false by default.

vitorestevam commented 2 years ago

can this be changed to support only nillable flag?

neo7337 commented 2 years ago

I'll have a look at this!

neo7337 commented 2 years ago

instead of required and nillable, we might be better off using the notnull validation