Add a Disable option in RulesOption for disabling the rule
I tried doing it with loop, but it gives problem. Here is the sample code which I tried.
r := reflect.ValueOf(validatorConfig.ValidatorRules)
for i := 0; i < r.NumField(); i++ {
a := r.Field(i)
fmt.Println(a.FieldByName("RuleOptions").FieldByName("Disable").String())
if a.FieldByName("RuleOptions").FieldByName("Disable").String() == "false" {
ruleConfig.Rules = append(ruleConfig.Rules, a.interface{}.(Rules)) // here is the issue
}
fmt.Println(ruleConfig.Rules)
}
Type of change
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Closes #197
Description
I tried doing it with loop, but it gives problem. Here is the sample code which I tried.
Type of change
Checklist