fix error message in validation test
This commit is contained in:
@@ -28,8 +28,8 @@ import (
|
|||||||
|
|
||||||
func expectPrefix(t *testing.T, prefix string, errs errors.ErrorList) {
|
func expectPrefix(t *testing.T, prefix string, errs errors.ErrorList) {
|
||||||
for i := range errs {
|
for i := range errs {
|
||||||
if !strings.HasPrefix(errs[i].(errors.ValidationError).Field, prefix) {
|
if f, p := errs[i].(errors.ValidationError).Field, prefix; !strings.HasPrefix(f, p) {
|
||||||
t.Errorf("expected prefix '%s' for %v", errs[i])
|
t.Errorf("expected prefix '%s' for field '%s' (%v)", p, f, errs[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user