-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
option to skip validation on nested struct if value is nil #1
Comments
This library tries to be small and composite, so any specific option will break this rule. In the use case you mentioned, you can achieve it by combining Assert and Lazy. See Nested struct pointer for an example. |
As a supplement, it seems impossible to check whether a nested struct is nil or not, without using reflection? |
That's correct without refection its not possible, yes i think using Assert and Lazy in Any clause works. |
Yeah, |
@twistedlog I am going to close this issue, you can create a new one if you encountered other problems :) |
There should be an option to skip validation of a nested struct if the nested struct's value is nil.
The text was updated successfully, but these errors were encountered: