From 62353be9adeb3ed8d914c2ab50ec91dd333433e8 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Wed, 2 Oct 2024 02:58:23 +0800 Subject: [PATCH] fix: fix slice assignment issue (#3964) Signed-off-by: cuishuang Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com> --- pkg/provider/azure/keyvault/keyvault_test.go | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/pkg/provider/azure/keyvault/keyvault_test.go b/pkg/provider/azure/keyvault/keyvault_test.go index 13afc41b3..585cd3e25 100644 --- a/pkg/provider/azure/keyvault/keyvault_test.go +++ b/pkg/provider/azure/keyvault/keyvault_test.go @@ -1415,11 +1415,8 @@ func TestAzureKeyVaultSecretManagerGetAllSecrets(t *testing.T) { Attributes: &enabledAtt, } - secretList := make([]keyvault.SecretItem, 0) - secretList = append(secretList, secretItem) - list := keyvault.SecretListResult{ - Value: &secretList, + Value: &[]keyvault.SecretItem{secretItem}, } resultPage := keyvault.NewSecretListResultPage(list, getNextPage) @@ -1447,11 +1444,8 @@ func TestAzureKeyVaultSecretManagerGetAllSecrets(t *testing.T) { Attributes: &enabledAtt, } - secretList := make([]keyvault.SecretItem, 1) - secretList = append(secretList, secretItemOne, secretItemTwo) - list := keyvault.SecretListResult{ - Value: &secretList, + Value: &[]keyvault.SecretItem{secretItemOne, secretItemTwo}, } resultPage := keyvault.NewSecretListResultPage(list, getNextPage) @@ -1475,11 +1469,8 @@ func TestAzureKeyVaultSecretManagerGetAllSecrets(t *testing.T) { Tags: map[string]*string{"environment": &environment}, } - secretList := make([]keyvault.SecretItem, 0) - secretList = append(secretList, secretItem) - list := keyvault.SecretListResult{ - Value: &secretList, + Value: &[]keyvault.SecretItem{secretItem}, } resultPage := keyvault.NewSecretListResultPage(list, getNextPage) @@ -1505,11 +1496,8 @@ func TestAzureKeyVaultSecretManagerGetAllSecrets(t *testing.T) { Tags: map[string]*string{"environment": &environment, "author": &author}, } - secretList := make([]keyvault.SecretItem, 0) - secretList = append(secretList, secretItem) - list := keyvault.SecretListResult{ - Value: &secretList, + Value: &[]keyvault.SecretItem{secretItem}, } resultPage := keyvault.NewSecretListResultPage(list, getNextPage)