From 56a330c533988750dd7b70be48ab278a71baa6fd Mon Sep 17 00:00:00 2001 From: Adam Lewandowski Date: Fri, 30 Mar 2018 07:53:59 -0400 Subject: [PATCH] Remove attribute values from ConflictsWith validation message --- helper/schema/schema.go | 4 ++-- helper/schema/schema_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/helper/schema/schema.go b/helper/schema/schema.go index c94b694ff..560d36683 100644 --- a/helper/schema/schema.go +++ b/helper/schema/schema.go @@ -1270,9 +1270,9 @@ func (m schemaMap) validateConflictingAttributes( } for _, conflicting_key := range schema.ConflictsWith { - if value, ok := c.Get(conflicting_key); ok { + if _, ok := c.Get(conflicting_key); ok { return fmt.Errorf( - "%q: conflicts with %s (%#v)", k, conflicting_key, value) + "%q: conflicts with %s", k, conflicting_key) } } diff --git a/helper/schema/schema_test.go b/helper/schema/schema_test.go index 4f50f9215..4b0d5afb8 100644 --- a/helper/schema/schema_test.go +++ b/helper/schema/schema_test.go @@ -4790,7 +4790,7 @@ func TestSchemaMap_Validate(t *testing.T) { Err: true, 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, 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, Errors: []error{ - fmt.Errorf(`"foo_att": conflicts with bar_att ("bar-val")`), - fmt.Errorf(`"bar_att": conflicts with foo_att ("foo-val")`), + fmt.Errorf(`"foo_att": conflicts with bar_att`), + fmt.Errorf(`"bar_att": conflicts with foo_att`), }, },