aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/zclconf/go-cty/cty/type_conform.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/zclconf/go-cty/cty/type_conform.go')
-rw-r--r--vendor/github.com/zclconf/go-cty/cty/type_conform.go29
1 files changed, 13 insertions, 16 deletions
diff --git a/vendor/github.com/zclconf/go-cty/cty/type_conform.go b/vendor/github.com/zclconf/go-cty/cty/type_conform.go
index b417dc7..476eeea 100644
--- a/vendor/github.com/zclconf/go-cty/cty/type_conform.go
+++ b/vendor/github.com/zclconf/go-cty/cty/type_conform.go
@@ -50,23 +50,20 @@ func testConformance(given Type, want Type, path Path, errs *[]error) {
50 givenAttrs := given.AttributeTypes() 50 givenAttrs := given.AttributeTypes()
51 wantAttrs := want.AttributeTypes() 51 wantAttrs := want.AttributeTypes()
52 52
53 if len(givenAttrs) != len(wantAttrs) { 53 for k := range givenAttrs {
54 // Something is missing from one of them. 54 if _, exists := wantAttrs[k]; !exists {
55 for k := range givenAttrs { 55 *errs = append(
56 if _, exists := wantAttrs[k]; !exists { 56 *errs,
57 *errs = append( 57 errorf(path, "unsupported attribute %q", k),
58 *errs, 58 )
59 errorf(path, "unsupported attribute %q", k),
60 )
61 }
62 } 59 }
63 for k := range wantAttrs { 60 }
64 if _, exists := givenAttrs[k]; !exists { 61 for k := range wantAttrs {
65 *errs = append( 62 if _, exists := givenAttrs[k]; !exists {
66 *errs, 63 *errs = append(
67 errorf(path, "missing required attribute %q", k), 64 *errs,
68 ) 65 errorf(path, "missing required attribute %q", k),
69 } 66 )
70 } 67 }
71 } 68 }
72 69