From 5c81f2cf9822886f1c2ebe15b668b0647c5fb7b9 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 5 Apr 2023 11:52:29 -0500 Subject: [PATCH] remove conflicts --- internal/flex/framework.go | 12 ---------- internal/flex/framework_test.go | 39 --------------------------------- 2 files changed, 51 deletions(-) diff --git a/internal/flex/framework.go b/internal/flex/framework.go index 4a5421bdeb6..192d17e71d6 100644 --- a/internal/flex/framework.go +++ b/internal/flex/framework.go @@ -201,18 +201,6 @@ func FlattenFrameworkStringValueSetLegacy(_ context.Context, vs []string) types. return types.SetValueMust(types.StringType, elems) } -// FlattenFrameworkStringSetLegacy is the Plugin Framework variant of FlattenStringSet. -// A nil slice is converted to an empty (non-null) Set. -func FlattenFrameworkStringSetLegacy(_ context.Context, vs []*string) types.Set { - elems := make([]attr.Value, len(vs)) - - for i, v := range vs { - elems[i] = types.StringValue(aws.ToString(v)) - } - - return types.SetValueMust(types.StringType, elems) -} - // FlattenFrameworkStringValueMapLegacy has no Plugin SDK equivalent as schema.ResourceData.Set can be passed string value maps directly. // A nil map is converted to an empty (non-null) Map. func FlattenFrameworkStringValueMapLegacy(_ context.Context, m map[string]string) types.Map { diff --git a/internal/flex/framework_test.go b/internal/flex/framework_test.go index 5d6d626543e..2ee82184b54 100644 --- a/internal/flex/framework_test.go +++ b/internal/flex/framework_test.go @@ -493,45 +493,6 @@ func TestFlattenFrameworkStringValueSetLegacy(t *testing.T) { } } -func TestFlattenFrameworkStringSetLegacy(t *testing.T) { - t.Parallel() - - type testCase struct { - input []*string - expected types.Set - } - tests := map[string]testCase{ - "two elements": { - input: []*string{aws.String("GET"), aws.String("HEAD")}, - expected: types.SetValueMust(types.StringType, []attr.Value{ - types.StringValue("GET"), - types.StringValue("HEAD"), - }), - }, - "zero elements": { - input: []*string{}, - expected: types.SetValueMust(types.StringType, []attr.Value{}), - }, - "nil array": { - input: nil, - expected: types.SetValueMust(types.StringType, []attr.Value{}), - }, - } - - for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { - t.Parallel() - - got := FlattenFrameworkStringSetLegacy(context.Background(), test.input) - - if diff := cmp.Diff(got, test.expected); diff != "" { - t.Errorf("unexpected diff (+wanted, -got): %s", diff) - } - }) - } -} - func TestFlattenFrameworkStringValueMapLegacy(t *testing.T) { t.Parallel()