Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up lint in aztables #22470

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions sdk/data/aztables/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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==")
}
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion sdk/data/aztables/recording_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions sdk/data/aztables/transactional_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down