validator
validator copied to clipboard
`excluded_with` doesn't work with structures
trafficstars
- [X] I have looked at the documentation here first?
- [X] I have looked at the examples provided that may showcase my question here?
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
excluded_with doesn't work with structures
Code sample, to showcase or reproduce:
type Test2 struct {
Test2 string
}
type Test struct {
Fire *Test2 `validate:"excluded_with=Water"`
Water *Test2 `validate:"excluded_with=Fire"`
}
func main() {
data := &Test2{}
v := validator.New()
fmt.Println(v.Struct(&Test{Fire: data, Water: data}))
}
google playground : https://go.dev/play/p/krYBBvE4zWZ
Also v curious if there's an answer to this one. @deankarn could you shed any light?
This seems like a bug, I've tested this one too
Is there any change in this question
Same here, and I didn't find any workaround :/