Remove attribute values from ConflictsWith validation message

This commit is contained in:
Adam Lewandowski 2018-03-30 07:53:59 -04:00
parent dfa623250a
commit 56a330c533
2 changed files with 6 additions and 6 deletions

View File

@ -1270,9 +1270,9 @@ func (m schemaMap) validateConflictingAttributes(
} }
for _, conflicting_key := range schema.ConflictsWith { for _, conflicting_key := range schema.ConflictsWith {
if value, ok := c.Get(conflicting_key); ok { if _, ok := c.Get(conflicting_key); ok {
return fmt.Errorf( return fmt.Errorf(
"%q: conflicts with %s (%#v)", k, conflicting_key, value) "%q: conflicts with %s", k, conflicting_key)
} }
} }

View File

@ -4790,7 +4790,7 @@ func TestSchemaMap_Validate(t *testing.T) {
Err: true, Err: true,
Errors: []error{ Errors: []error{
fmt.Errorf("\"blacklist\": conflicts with whitelist (\"white-val\")"), fmt.Errorf("\"blacklist\": conflicts with whitelist"),
}, },
}, },
@ -4834,7 +4834,7 @@ func TestSchemaMap_Validate(t *testing.T) {
Err: true, Err: true,
Errors: []error{ Errors: []error{
fmt.Errorf(`"optional_att": conflicts with required_att ("required-val")`), fmt.Errorf(`"optional_att": conflicts with required_att`),
}, },
}, },
@ -4861,8 +4861,8 @@ func TestSchemaMap_Validate(t *testing.T) {
Err: true, Err: true,
Errors: []error{ Errors: []error{
fmt.Errorf(`"foo_att": conflicts with bar_att ("bar-val")`), fmt.Errorf(`"foo_att": conflicts with bar_att`),
fmt.Errorf(`"bar_att": conflicts with foo_att ("foo-val")`), fmt.Errorf(`"bar_att": conflicts with foo_att`),
}, },
}, },