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
You can do something like this. Since it is treating 0 as empty.
data := float64(0)
err := validation.Validate(data,
validation.Min(float64(0)).Exclusive(),
validation.NilOrNotEmpty.Error("must be greater than 0"),
)
fmt.Println(err)
Hi! I stumbled upon the following situation: validating a number's minimum threshold does not work as intended when said threshold is 0.
The following snippet works as expected, printing "must be greater than 1":
However, changing the threshold to 0 nullifies the error:
^ prints "<nil>" (i.e. no error).
The text was updated successfully, but these errors were encountered: