From 43d2f10fa30ffb3ab7f6f9fba1ce54f0a020344a Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Wed, 28 Feb 2024 08:42:43 -0800 Subject: [PATCH] Clean up lint in aztables (#22470) Fixed some unused parameters. --- sdk/data/aztables/proxy_test.go | 10 +++++----- sdk/data/aztables/recording_helpers_test.go | 2 +- sdk/data/aztables/transactional_batch.go | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk/data/aztables/proxy_test.go b/sdk/data/aztables/proxy_test.go index 09912030d6c6..5d80fe688013 100644 --- a/sdk/data/aztables/proxy_test.go +++ b/sdk/data/aztables/proxy_test.go @@ -188,7 +188,7 @@ func initServiceTest(t *testing.T, service string, tp tracing.Provider) (*Servic } } -func getSharedKeyCredential(t *testing.T) (*SharedKeyCredential, error) { +func getSharedKeyCredential() (*SharedKeyCredential, error) { if recording.GetRecordMode() == "playback" { return NewSharedKeyCredential("accountName", "daaaaaaaaaabbbbbbbbbbcccccccccccccccccccdddddddddddddddddddeeeeeeeeeeefffffffffffggggg==") } @@ -206,7 +206,7 @@ func createStorageClient(t *testing.T, tp tracing.Provider) (*Client, error) { accountKey := recording.GetEnvVariable("TABLES_PRIMARY_STORAGE_ACCOUNT_KEY", "fakeaccountkey") if recording.GetRecordMode() == "playback" { - cred, err = getSharedKeyCredential(t) + cred, err = getSharedKeyCredential() require.NoError(t, err) } else { cred, err = NewSharedKeyCredential(accountName, accountKey) @@ -228,7 +228,7 @@ func createCosmosClient(t *testing.T, tp tracing.Provider) (*Client, error) { accountName = "fakeaccount" } - cred, err := getSharedKeyCredential(t) + cred, err := getSharedKeyCredential() require.NoError(t, err) serviceURL := cosmosURI(accountName) @@ -246,7 +246,7 @@ func createStorageServiceClient(t *testing.T, tp tracing.Provider) (*ServiceClie accountKey := recording.GetEnvVariable("TABLES_PRIMARY_STORAGE_ACCOUNT_KEY", "fakeaccountkey") if recording.GetRecordMode() == "playback" { - cred, err = getSharedKeyCredential(t) + cred, err = getSharedKeyCredential() require.NoError(t, err) } else { cred, err = NewSharedKeyCredential(accountName, accountKey) @@ -265,7 +265,7 @@ func createCosmosServiceClient(t *testing.T, tp tracing.Provider) (*ServiceClien accountName = "fakeaccount" } - cred, err := getSharedKeyCredential(t) + cred, err := getSharedKeyCredential() require.NoError(t, err) serviceURL := cosmosURI(accountName) diff --git a/sdk/data/aztables/recording_helpers_test.go b/sdk/data/aztables/recording_helpers_test.go index d28b2fed9841..7a000dffb154 100644 --- a/sdk/data/aztables/recording_helpers_test.go +++ b/sdk/data/aztables/recording_helpers_test.go @@ -103,7 +103,7 @@ func createSimpleEntities(count int, pk string) *[]basicTestEntity { func createComplexEntity(i int, pk string) complexTestEntity { return complexTestEntity{ Entity: Entity{ - PartitionKey: "partition", + PartitionKey: pk, RowKey: fmt.Sprint(i), }, Integer: int(i), diff --git a/sdk/data/aztables/transactional_batch.go b/sdk/data/aztables/transactional_batch.go index 56b0d21eeb92..6b192e19c057 100644 --- a/sdk/data/aztables/transactional_batch.go +++ b/sdk/data/aztables/transactional_batch.go @@ -54,7 +54,7 @@ func (t *Client) SubmitTransaction(ctx context.Context, transactionActions []Tra } // submitTransactionInternal is the internal implementation for SubmitTransaction. It allows for explicit configuration of the batch and changeset UUID values for testing. -func (t *Client) submitTransactionInternal(ctx context.Context, transactionActions []TransactionAction, batchUuid uuid.UUID, changesetUuid uuid.UUID, tableSubmitTransactionOptions *SubmitTransactionOptions) (TransactionResponse, error) { +func (t *Client) submitTransactionInternal(ctx context.Context, transactionActions []TransactionAction, batchUuid uuid.UUID, changesetUuid uuid.UUID, _ *SubmitTransactionOptions) (TransactionResponse, error) { if len(transactionActions) == 0 { return TransactionResponse{}, errEmptyTransaction } @@ -104,11 +104,11 @@ func (t *Client) submitTransactionInternal(ctx context.Context, transactionActio return TransactionResponse{}, runtime.NewResponseError(resp) } - return buildTransactionResponse(req, resp, len(transactionActions)) + return buildTransactionResponse(req, resp) } // create the transaction response. This will read the inner responses -func buildTransactionResponse(req *policy.Request, resp *http.Response, itemCount int) (TransactionResponse, error) { +func buildTransactionResponse(req *policy.Request, resp *http.Response) (TransactionResponse, error) { bytesBody, err := io.ReadAll(resp.Body) if err != nil { return TransactionResponse{}, err