From 4f7351722442fab61668a90d10dc67c9caafab84 Mon Sep 17 00:00:00 2001 From: vicentepinto98 Date: Tue, 10 Oct 2023 15:48:43 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20lint=20issues=C2=A7=20g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/objectstorage/credentialsgroup/resource.go | 6 +++--- .../objectstorage/credentialsgroup/resource_test.go | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/stackit/internal/services/objectstorage/credentialsgroup/resource.go b/stackit/internal/services/objectstorage/credentialsgroup/resource.go index 3d9b723a..0f4e64a5 100644 --- a/stackit/internal/services/objectstorage/credentialsgroup/resource.go +++ b/stackit/internal/services/objectstorage/credentialsgroup/resource.go @@ -275,11 +275,11 @@ func mapFields(credentialsGroupResp *objectstorage.CreateCredentialsGroupRespons } credentialsGroup := credentialsGroupResp.CredentialsGroup - mapCredentialsGroup(credentialsGroup, model) + mapCredentialsGroup(*credentialsGroup, model) return nil } -func mapCredentialsGroup(credentialsGroup *objectstorage.CredentialsGroup, model *Model) { +func mapCredentialsGroup(credentialsGroup objectstorage.CredentialsGroup, model *Model) { model.CredentialsGroupId = types.StringPointerValue(credentialsGroup.CredentialsGroupId) model.URN = types.StringPointerValue(credentialsGroup.Urn) model.Name = types.StringPointerValue(credentialsGroup.DisplayName) @@ -328,7 +328,7 @@ func readCredentialsGroups(ctx context.Context, model *Model, projectId string, continue } found = true - mapCredentialsGroup(&credentialsGroup, model) + mapCredentialsGroup(credentialsGroup, model) break } diff --git a/stackit/internal/services/objectstorage/credentialsgroup/resource_test.go b/stackit/internal/services/objectstorage/credentialsgroup/resource_test.go index c01a1581..dc4111c2 100644 --- a/stackit/internal/services/objectstorage/credentialsgroup/resource_test.go +++ b/stackit/internal/services/objectstorage/credentialsgroup/resource_test.go @@ -16,7 +16,7 @@ type objectStorageClientMocked struct { getCredentialsGroupsResponse *objectstorage.GetCredentialsGroupsResponse } -func (c *objectStorageClientMocked) GetCredentialsGroupsExecute(ctx context.Context, projectId string) (*objectstorage.GetCredentialsGroupsResponse, error) { +func (c *objectStorageClientMocked) GetCredentialsGroupsExecute(_ context.Context, _ string) (*objectstorage.GetCredentialsGroupsResponse, error) { if c.getCredentialsGroupsFails { return c.getCredentialsGroupsResponse, fmt.Errorf("get credentials groups failed") } @@ -221,7 +221,6 @@ func TestReadCredentialsGroups(t *testing.T) { } for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { - client := &objectStorageClientMocked{ getCredentialsGroupsFails: tt.getCredentialsGroupsFails, getCredentialsGroupsResponse: tt.mockedResp,