|
|
@ -20,6 +20,7 @@ import ( |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
const ( |
|
|
|
|
|
|
|
utf8HexComma = "0x2C" |
|
|
|
tagSeparator = "," |
|
|
|
tagSeparator = "," |
|
|
|
orSeparator = "|" |
|
|
|
orSeparator = "|" |
|
|
|
noValidationTag = "-" |
|
|
|
noValidationTag = "-" |
|
|
@ -428,7 +429,7 @@ func (v *Validate) fieldWithNameAndValue(val interface{}, current interface{}, f |
|
|
|
cField.tags = append(cField.tags, cTag) |
|
|
|
cField.tags = append(cField.tags, cTag) |
|
|
|
|
|
|
|
|
|
|
|
for i, val := range orVals { |
|
|
|
for i, val := range orVals { |
|
|
|
vals := strings.Split(val, tagKeySeparator) |
|
|
|
vals := strings.SplitN(val, tagKeySeparator, 2) |
|
|
|
|
|
|
|
|
|
|
|
key := strings.TrimSpace(vals[0]) |
|
|
|
key := strings.TrimSpace(vals[0]) |
|
|
|
|
|
|
|
|
|
|
@ -438,7 +439,7 @@ func (v *Validate) fieldWithNameAndValue(val interface{}, current interface{}, f |
|
|
|
|
|
|
|
|
|
|
|
param := "" |
|
|
|
param := "" |
|
|
|
if len(vals) > 1 { |
|
|
|
if len(vals) > 1 { |
|
|
|
param = vals[1] |
|
|
|
param = strings.Replace(vals[1], utf8HexComma, ",", -1) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
cTag.keyVals[i] = []string{key, param} |
|
|
|
cTag.keyVals[i] = []string{key, param} |
|
|
|