validate: promote invalid values to an error

This commit is contained in:
Alex Crawford
2014-11-26 10:22:39 -08:00
parent 4e466c12da
commit 7447e133c9
2 changed files with 3 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ func checkValidity(cfg node, report *Report) {
func checkNodeValidity(n, g node, r *Report) {
if err := config.AssertValid(n.Value, g.field.Tag.Get("valid")); err != nil {
r.Warning(n.line, fmt.Sprintf("invalid value %v", n.Value))
r.Error(n.line, fmt.Sprintf("invalid value %v", n.Value))
}
switch g.Kind() {
case reflect.Struct: