diff --git a/generator.go b/generator.go index de8bd7c..58b3084 100644 --- a/generator.go +++ b/generator.go @@ -135,11 +135,12 @@ func (o *generatorS) validator(input interface{}) Validator { if bindingTags := elementT.Tag.Get("binding"); bindingTags != "" { splits := strings.Split(bindingTags, ",") for j := 0; j < len(splits); j++ { - value := elementT.Tag.Get("_" + splits[j]) + rule := strings.Split(splits[j], "=") + value := elementT.Tag.Get("_" + rule[0]) if value == "" { - value = elementT.Tag.Get(splits[j]) + value = elementT.Tag.Get(rule[0]) } - addSpecificMessage(r, splits[j], value) + addSpecificMessage(r, rule[0], value) } } rules[elementT.Name] = r