You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the different validators, the functions panic if the type is unknown, I think it would be more go-compliant to return an error. According to me, if the type is not supported, it should be simply a validation error.
What do you thing of that?
The text was updated successfully, but these errors were encountered:
The reason I did it this way is that I see the tags as being an integral
part of the struct definition and to be honest I wish I could make them
cause a syntax error at compile time if I could. Since I couldn't, I
thought they should fail as hard and soon as possible.
That said, I did this before I ended up exporting a second function that
allows rules as a function parameter, so yes, I can see how a panic might
not be appropriate there. I might have to change that.
In the different validators, the functions panic if the type is unknown, I think it would be more go-compliant to return an error. According to me, if the type is not supported, it should be simply a validation error.
What do you thing of that?
The text was updated successfully, but these errors were encountered: