govalidator
govalidator copied to clipboard
Validation of a pointer to a variable of type bool now checks the value of the variable, not the pointer
BC Break Report
Summary
Validation of a pointer to a variable of type bool now checks the value of the variable, not the pointer. Error of compatibility has.
Previous behavior (one month ago)
Q | A |
---|---|
Version | v0.0.0-20200108200545-475eaeb16496 |
var v struct { Value *bool json:"value" valid:"required"
}
json.Unmarshal([]byte({"value":false}
), &v)
ok, err := govalidator.ValidateStruct(v) =>
ok | err |
---|---|
True | nil |
Current behavior
Q | A |
---|---|
Version | v0.0.0-20210307081110-f21760c49a8d |
=>
ok | err |
---|---|
False | error "non zero value required" |
How to ensure compatibility?
see the same issue. This seems a regression.