From e5168947ec073a61e09c08367f184ee6425b55ea Mon Sep 17 00:00:00 2001 From: Charles Lowell <10964656+chlowell@users.noreply.github.com> Date: Tue, 9 Aug 2022 12:50:34 -0700 Subject: [PATCH] fmt with Go 1.19 --- sdk/azidentity/default_azure_credential.go | 8 +- sdk/azidentity/environment_credential.go | 6 +- sdk/data/azcosmos/doc.go | 42 ++-- sdk/data/azcosmos/shared_key_credential.go | 2 +- sdk/data/aztables/client.go | 4 +- sdk/data/aztables/doc.go | 35 ++- sdk/data/aztables/service_client.go | 4 +- .../azeventhubs/internal/go-amqp/client.go | 3 +- .../go-amqp/internal/frames/frames.go | 186 ++++++++-------- .../internal/go-amqp/link_options.go | 12 +- .../internal/go-amqp/manualCreditor.go | 7 +- .../azeventhubs/internal/test/test_helpers.go | 11 +- .../azservicebus/internal/amqpLinks.go | 3 +- .../azservicebus/internal/go-amqp/client.go | 4 +- .../armconsumption/zz_generated_models.go | 2 - .../armcostmanagement/zz_generated_models.go | 3 - ...ataflowdebugsession_client_example_test.go | 2 +- .../zz_generated_assignments_client.go | 14 +- .../zz_generated_definitions_client.go | 4 +- .../zz_generated_exemptions_client.go | 14 +- .../zz_generated_setdefinitions_client.go | 4 +- .../managed-identity/functions/handler.go | 10 +- sdk/storage/azblob/constants.go | 2 +- sdk/storage/azblob/zc_blob_client.go | 2 +- sdk/storage/azblob/zc_blob_lease_client.go | 2 +- .../azblob/zc_container_lease_client.go | 2 +- sdk/storage/azblob/zc_service_client.go | 4 +- sdk/storage/azblob/zc_storage_error.go | 6 +- sdk/storage/azblob/zc_storage_error_test.go | 2 +- .../azblob/zm_container_client_util.go | 2 +- sdk/storage/azblob/zt_access_policy_test.go | 8 +- .../azblob/zt_append_blob_client_test.go | 8 +- sdk/storage/azblob/zt_blob_client_test.go | 12 +- sdk/storage/azblob/zt_blob_tags_test.go | 22 +- sdk/storage/azblob/zt_blob_versioning_test.go | 200 +++++++++--------- .../azblob/zt_block_blob_client_test.go | 12 +- sdk/storage/azblob/zt_bytes_writer_test.go | 2 +- sdk/storage/azblob/zt_chunkwriting_test.go | 20 +- .../azblob/zt_client_provided_key_test.go | 24 +-- sdk/storage/azblob/zt_highlevel_test.go | 56 ++--- sdk/storage/azblob/zt_lease_client_test.go | 2 +- sdk/storage/azblob/zt_ors_test.go | 2 +- .../azblob/zt_page_blob_client_test.go | 38 ++-- sdk/storage/azblob/zt_retry_reader_test.go | 22 +- sdk/storage/azblob/zt_section_writer_test.go | 6 +- sdk/storage/azblob/zt_service_client_test.go | 8 +- sdk/storage/azblob/zt_test.go | 26 +-- sdk/storage/azblob/zz_generated_models.go | 2 +- 48 files changed, 441 insertions(+), 431 deletions(-) diff --git a/sdk/azidentity/default_azure_credential.go b/sdk/azidentity/default_azure_credential.go index 7358558acb57..7e7ae8553bf3 100644 --- a/sdk/azidentity/default_azure_credential.go +++ b/sdk/azidentity/default_azure_credential.go @@ -31,9 +31,11 @@ type DefaultAzureCredentialOptions struct { // DefaultAzureCredential is a default credential chain for applications that will deploy to Azure. // It combines credentials suitable for deployment with credentials suitable for local development. // It attempts to authenticate with each of these credential types, in the following order, stopping when one provides a token: -// EnvironmentCredential -// ManagedIdentityCredential -// AzureCLICredential +// +// EnvironmentCredential +// ManagedIdentityCredential +// AzureCLICredential +// // Consult the documentation for these credential types for more information on how they authenticate. // Once a credential has successfully authenticated, DefaultAzureCredential will use that credential for // every subsequent authentication. diff --git a/sdk/azidentity/environment_credential.go b/sdk/azidentity/environment_credential.go index 6b2a9bab6e33..52ae2345778d 100644 --- a/sdk/azidentity/environment_credential.go +++ b/sdk/azidentity/environment_credential.go @@ -28,7 +28,7 @@ type EnvironmentCredentialOptions struct { // EnvironmentCredential authenticates a service principal with a secret or certificate, or a user with a password, depending // on environment variable configuration. It reads configuration from these variables, in the following order: // -// Service principal with client secret +// # Service principal with client secret // // AZURE_TENANT_ID: ID of the service principal's tenant. Also called its "directory" ID. // @@ -36,7 +36,7 @@ type EnvironmentCredentialOptions struct { // // AZURE_CLIENT_SECRET: one of the service principal's client secrets // -// Service principal with certificate +// # Service principal with certificate // // AZURE_TENANT_ID: ID of the service principal's tenant. Also called its "directory" ID. // @@ -46,7 +46,7 @@ type EnvironmentCredentialOptions struct { // // AZURE_CLIENT_CERTIFICATE_PASSWORD: (optional) password for the certificate file. // -// User with username and password +// # User with username and password // // AZURE_TENANT_ID: (optional) tenant to authenticate in. Defaults to "organizations". // diff --git a/sdk/data/azcosmos/doc.go b/sdk/data/azcosmos/doc.go index 3a58fc0f8ac3..1a9d264c0acf 100644 --- a/sdk/data/azcosmos/doc.go +++ b/sdk/data/azcosmos/doc.go @@ -6,11 +6,11 @@ Package azcosmos implements the client to interact with the Azure Cosmos DB SQL API. The azcosmos package is capable of: - - Creating, deleting, and reading databases in an account - - Creating, deleting, updating, and reading containers in a database - - Creating, deleting, replacing, upserting, and reading items in a container + - Creating, deleting, and reading databases in an account + - Creating, deleting, updating, and reading containers in a database + - Creating, deleting, replacing, upserting, and reading items in a container -Creating the Client +# Creating the Client Types of Credentials The clients support different forms of authentication. The azcosmos library supports @@ -18,12 +18,12 @@ authorization via Azure Active Directory or an account key. Using Azure Active Directory To create a client, you can use any of the TokenCredential implementations provided by `azidentity`. + cred, err := azidentity.NewClientSecretCredential("tenantId", "clientId", "clientSecret") handle(err) client, err := azcosmos.NewClient("myAccountEndpointURL", cred, nil) handle(err) - Using account keys To create a client, you will need the account's endpoint URL and a key credential. @@ -32,34 +32,30 @@ To create a client, you will need the account's endpoint URL and a key credentia client, err := azcosmos.NewClientWithKey("myAccountEndpointURL", cred, nil) handle(err) - Using connection string To create a client, you will need the account's connection string. client, err := azcosmos.NewClientFromConnectionString("myConnectionString", nil) handle(err) - -Key Concepts +# Key Concepts The following are relevant concepts for the usage of the client: - - A client is a connection to an Azure Cosmos DB account. - - An account can have multiple databases, and the client allows you to create, read, and delete databases. - - A database can have multiple containers, and the client allows you to create, read, update, and delete containers, and to modify throughput provision. - - Information is stored as items inside containers and the client allows you to create, read, update, and delete items in containers. + - A client is a connection to an Azure Cosmos DB account. + - An account can have multiple databases, and the client allows you to create, read, and delete databases. + - A database can have multiple containers, and the client allows you to create, read, update, and delete containers, and to modify throughput provision. + - Information is stored as items inside containers and the client allows you to create, read, update, and delete items in containers. - -More Examples +# More Examples The following sections provide several code snippets covering some of the most common Table tasks, including: - - Creating a database - - Creating a container - - Creating, reading, and deleting items - - Querying items - - Using Transactional Batch - + - Creating a database + - Creating a container + - Creating, reading, and deleting items + - Querying items + - Using Transactional Batch -Creating a database +# Creating a database Create a database and obtain a `DatabaseClient` to perform operations on your newly created database. @@ -73,8 +69,7 @@ Create a database and obtain a `DatabaseClient` to perform operations on your ne database, err := azcosmos.NewDatabase("myDatabase") handle(err) - -Creating a container +# Creating a container Create a container on an existing database and obtain a `ContainerClient` to perform operations on your newly created container. @@ -145,6 +140,7 @@ Querying items } Querying items with parametrized queries + &opt := azcosmos.QueryOptions{ azcosmos.QueryParameters: []QueryParameter{ {"@value", "2"}, diff --git a/sdk/data/azcosmos/shared_key_credential.go b/sdk/data/azcosmos/shared_key_credential.go index 0eba077f728e..e9f3715e64bb 100644 --- a/sdk/data/azcosmos/shared_key_credential.go +++ b/sdk/data/azcosmos/shared_key_credential.go @@ -75,7 +75,7 @@ func (c *KeyCredential) buildCanonicalizedAuthHeaderFromRequest(req *policy.Requ return value, nil } -//where date is like time.RFC1123 but hard-codes GMT as the time zone +// where date is like time.RFC1123 but hard-codes GMT as the time zone func (c *KeyCredential) buildCanonicalizedAuthHeader(method, resourceType, resourceAddress, xmsDate, tokenType, version string) string { if method == "" || resourceType == "" { return "" diff --git a/sdk/data/aztables/client.go b/sdk/data/aztables/client.go index 2e19c1c53c45..7aaacf0c2592 100644 --- a/sdk/data/aztables/client.go +++ b/sdk/data/aztables/client.go @@ -215,8 +215,8 @@ func newListEntitiesPage(resp generated.TableClientQueryEntitiesResponse) (ListE // // NewListEntitiesPager returns a Pager, which allows iteration through each page of results. Use nil for listOptions if you want to use the default options. // For more information about writing query strings, check out: -// - API Documentation: https://docs.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities -// - README samples: https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/data/aztables/README.md#writing-filters +// - API Documentation: https://docs.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities +// - README samples: https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/data/aztables/README.md#writing-filters func (t *Client) NewListEntitiesPager(listOptions *ListEntitiesOptions) *runtime.Pager[ListEntitiesResponse] { if listOptions == nil { listOptions = &ListEntitiesOptions{} diff --git a/sdk/data/aztables/doc.go b/sdk/data/aztables/doc.go index 72a7b1e8b865..e346e9047163 100644 --- a/sdk/data/aztables/doc.go +++ b/sdk/data/aztables/doc.go @@ -6,15 +6,14 @@ // license that can be found in the LICENSE file. /* - Package aztables can access an Azure Storage or CosmosDB account. The aztables package is capable of: - - Creating, deleting, and listing tables in an account - - Creating, deleting, updating, and querying entities in a table account - - Creating Shared Access Signatures for authentication + - Creating, deleting, and listing tables in an account + - Creating, deleting, updating, and querying entities in a table account + - Creating Shared Access Signatures for authentication -Creating the Client +# Creating the Client The Azure Data Tables library allows you to interact with two types of resources: * the tables in your account @@ -28,14 +27,13 @@ URL and a credential that allows you to access the account. serviceClient, err := aztables.NewServiceClient("https://.table.core.windows.net/", cred, nil) handle(err) - -Types of Credentials +# Types of Credentials The clients support different forms of authentication. The aztables library supports any of the `azcore.TokenCredential` interfaces, authorization via a Connection String, or authorization with a Shared Access Signature token. -Using a Shared Key +# Using a Shared Key To use an account shared key (aka account key or access key), provide the key as a string. This can be found in your storage account in the Azure Portal under the "Access Keys" section. @@ -74,8 +72,7 @@ ServiceClient.GetAccountSASToken or Client.GetTableSASToken() functions. sasService, err := aztables.NewServiceClient(sasUrl, azcore.AnonymousCredential(), nil) handle(err) - -Key Concepts +# Key Concepts Common uses of the Table service included: * Storing TBs of structured data capable of serving web scale applications @@ -93,13 +90,14 @@ through the use of a dedicated client object. Two different clients are provided to interact with the various components of the Table Service: 1. **`ServiceClient`** - - * Get and set account setting - * Query, create, and delete tables within the account. - * Get a `Client` to access a specific table using the `NewClient` method. + - Get and set account setting + - Query, create, and delete tables within the account. + - Get a `Client` to access a specific table using the `NewClient` method. + 2. **`Client`** - - * Interacts with a specific table (which need not exist yet). - * Create, delete, query, and upsert entities within the specified table. - * Create or delete the specified table itself. + - Interacts with a specific table (which need not exist yet). + - Create, delete, query, and upsert entities within the specified table. + - Create or delete the specified table itself. Entities are similar to rows. An entity has a PartitionKey, a RowKey, and a set of properties. A property is a name value pair, similar to a column. Every entity in a table does not need to @@ -122,7 +120,7 @@ ensure proper round-trip serialization of all properties. } } -More Examples +# More Examples The following sections provide several code snippets covering some of the most common Table tasks, including: @@ -130,8 +128,7 @@ The following sections provide several code snippets covering some of the most c * Creating entities * Querying entities - -Creating a Table +# Creating a Table Create a table in your account and get a `Client` to perform operations on the newly created table: diff --git a/sdk/data/aztables/service_client.go b/sdk/data/aztables/service_client.go index 0af9c5fc8f90..90d64be20995 100644 --- a/sdk/data/aztables/service_client.go +++ b/sdk/data/aztables/service_client.go @@ -218,8 +218,8 @@ func fromGeneratedTableResponseProperties(g *generated.TableResponseProperties) // // NewListTablesPager returns a Pager, which allows iteration through each page of results. Specify nil for listOptions if you want to use the default options. // For more information about writing query strings, check out: -// - API Documentation: https://docs.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities -// - README samples: https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/data/aztables/README.md#writing-filters +// - API Documentation: https://docs.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities +// - README samples: https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/data/aztables/README.md#writing-filters func (t *ServiceClient) NewListTablesPager(listOptions *ListTablesOptions) *runtime.Pager[ListTablesResponse] { if listOptions == nil { listOptions = &ListTablesOptions{} diff --git a/sdk/messaging/azeventhubs/internal/go-amqp/client.go b/sdk/messaging/azeventhubs/internal/go-amqp/client.go index 3cf8057e9ce3..70ec26f63c01 100644 --- a/sdk/messaging/azeventhubs/internal/go-amqp/client.go +++ b/sdk/messaging/azeventhubs/internal/go-amqp/client.go @@ -172,8 +172,7 @@ func randString(n int) string { // linkKey uniquely identifies a link on a connection by name and direction. // -// A link can be identified uniquely by the ordered tuple -// (source-container-id, target-container-id, name) +// A link can be identified uniquely by the ordered tuple (source-container-id, target-container-id, name). // On a single connection the container ID pairs can be abbreviated // to a boolean flag indicating the direction of the link. type linkKey struct { diff --git a/sdk/messaging/azeventhubs/internal/go-amqp/internal/frames/frames.go b/sdk/messaging/azeventhubs/internal/go-amqp/internal/frames/frames.go index ab542a17c057..ae21d97f7f4c 100644 --- a/sdk/messaging/azeventhubs/internal/go-amqp/internal/frames/frames.go +++ b/sdk/messaging/azeventhubs/internal/go-amqp/internal/frames/frames.go @@ -14,18 +14,20 @@ import ( /* - - - - - - - - - - - - + + + + + + + + + + + + + + */ type Source struct { @@ -198,14 +200,16 @@ func (s Source) String() string { /* - - - - - - - - + + + + + + + + + + */ type Target struct { @@ -427,15 +431,17 @@ func (o *PerformOpen) String() string { /* - - - - - - - - - + + + + + + + + + + + */ type PerformBegin struct { @@ -528,21 +534,23 @@ func (b *PerformBegin) Unmarshal(r *buffer.Buffer) error { /* - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + */ type PerformAttach struct { @@ -739,18 +747,20 @@ func (a *PerformAttach) Unmarshal(r *buffer.Buffer) error { /* - - - - - - - - - - - - + + + + + + + + + + + + + + */ type PerformFlow struct { @@ -912,18 +922,20 @@ func (f *PerformFlow) Unmarshal(r *buffer.Buffer) error { /* - - - - - - - - - - - - + + + + + + + + + + + + + + */ type PerformTransfer struct { @@ -1143,13 +1155,15 @@ func (t *PerformTransfer) Unmarshal(r *buffer.Buffer) error { /* - - - - - - - + + + + + + + + + */ type PerformDisposition struct { @@ -1227,10 +1241,12 @@ func (d *PerformDisposition) Unmarshal(r *buffer.Buffer) error { /* - - - - + + + + + + */ type PerformDetach struct { @@ -1275,8 +1291,10 @@ func (d *PerformDetach) Unmarshal(r *buffer.Buffer) error { /* - - + + + + */ type PerformEnd struct { @@ -1303,8 +1321,10 @@ func (e *PerformEnd) Unmarshal(r *buffer.Buffer) error { /* - - + + + + */ type PerformClose struct { diff --git a/sdk/messaging/azeventhubs/internal/go-amqp/link_options.go b/sdk/messaging/azeventhubs/internal/go-amqp/link_options.go index 29aa756b6bc3..465dffd1c705 100644 --- a/sdk/messaging/azeventhubs/internal/go-amqp/link_options.go +++ b/sdk/messaging/azeventhubs/internal/go-amqp/link_options.go @@ -177,14 +177,18 @@ type ReceiverOptions struct { // Example: // // The standard selector-filter is defined as: -// +// +// +// // In this case the name is "apache.org:selector-filter:string" and the code is // 0x0000468C00000004. -// LinkSourceFilter("apache.org:selector-filter:string", 0x0000468C00000004, exampleValue) +// +// LinkSourceFilter("apache.org:selector-filter:string", 0x0000468C00000004, exampleValue) // // References: -// http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-filter-set -// http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html#section-descriptor-values +// +// http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-filter-set +// http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html#section-descriptor-values type LinkFilter func(encoding.Filter) // LinkFilterSource creates or updates the named filter for this LinkFilter. diff --git a/sdk/messaging/azeventhubs/internal/go-amqp/manualCreditor.go b/sdk/messaging/azeventhubs/internal/go-amqp/manualCreditor.go index ecfc71477edb..6b50d5c1abae 100644 --- a/sdk/messaging/azeventhubs/internal/go-amqp/manualCreditor.go +++ b/sdk/messaging/azeventhubs/internal/go-amqp/manualCreditor.go @@ -36,9 +36,10 @@ func (mc *manualCreditor) EndDrain() { // FlowBits gets gets the proper values for the next flow frame // and resets the internal state. // Returns: -// (drain: true, credits: 0) if a flow is needed (drain) -// (drain: false, credits > 0) if a flow is needed (issue credit) -// (drain: false, credits == 0) if no flow needed. +// +// (drain: true, credits: 0) if a flow is needed (drain) +// (drain: false, credits > 0) if a flow is needed (issue credit) +// (drain: false, credits == 0) if no flow needed. func (mc *manualCreditor) FlowBits(currentCredits uint32) (bool, uint32) { mc.mu.Lock() defer mc.mu.Unlock() diff --git a/sdk/messaging/azeventhubs/internal/test/test_helpers.go b/sdk/messaging/azeventhubs/internal/test/test_helpers.go index 2f67260d37cb..f5a82ea55902 100644 --- a/sdk/messaging/azeventhubs/internal/test/test_helpers.go +++ b/sdk/messaging/azeventhubs/internal/test/test_helpers.go @@ -16,14 +16,13 @@ import ( // Returns a function that ends log capturing and returns any captured messages. // It's safe to call endCapture() multiple times, so a simple call pattern is: // -// endCapture := CaptureLogsForTest() -// defer endCapture() // ensure cleanup in case of test assert failures +// endCapture := CaptureLogsForTest() +// defer endCapture() // ensure cleanup in case of test assert failures // -// /* some test code */ -// -// messages := endCapture() -// /* do inspection of log messages */ +// /* some test code */ // +// messages := endCapture() +// /* do inspection of log messages */ func CaptureLogsForTest() func() []string { messagesCh := make(chan string, 10000) return CaptureLogsForTestWithChannel(messagesCh) diff --git a/sdk/messaging/azservicebus/internal/amqpLinks.go b/sdk/messaging/azservicebus/internal/amqpLinks.go index c24a5ddd25e1..7e640fe9b56a 100644 --- a/sdk/messaging/azservicebus/internal/amqpLinks.go +++ b/sdk/messaging/azservicebus/internal/amqpLinks.go @@ -56,8 +56,7 @@ type AMQPLinks interface { } // AMQPLinksImpl manages the set of AMQP links (and detritus) typically needed to work -// -// within Service Bus: +// within Service Bus: // // - An *goamqp.Sender or *goamqp.Receiver AMQP link (could also be 'both' if needed) // - A `$management` link diff --git a/sdk/messaging/azservicebus/internal/go-amqp/client.go b/sdk/messaging/azservicebus/internal/go-amqp/client.go index 485b88a28a49..a955928d0301 100644 --- a/sdk/messaging/azservicebus/internal/go-amqp/client.go +++ b/sdk/messaging/azservicebus/internal/go-amqp/client.go @@ -172,9 +172,7 @@ func randString(n int) string { // linkKey uniquely identifies a link on a connection by name and direction. // -// A link can be identified uniquely by the ordered tuple -// -// (source-container-id, target-container-id, name) +// A link can be identified uniquely by the ordered tuple (source-container-id, target-container-id, name) // // On a single connection the container ID pairs can be abbreviated // to a boolean flag indicating the direction of the link. diff --git a/sdk/resourcemanager/consumption/armconsumption/zz_generated_models.go b/sdk/resourcemanager/consumption/armconsumption/zz_generated_models.go index 176aa9f0ae27..28da3ba54528 100644 --- a/sdk/resourcemanager/consumption/armconsumption/zz_generated_models.go +++ b/sdk/resourcemanager/consumption/armconsumption/zz_generated_models.go @@ -417,7 +417,6 @@ type ErrorDetails struct { // * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" // header. // -// // * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" // header. type ErrorResponse struct { @@ -566,7 +565,6 @@ type HighCasedErrorDetails struct { // * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" // header. // -// // * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" // header. type HighCasedErrorResponse struct { diff --git a/sdk/resourcemanager/costmanagement/armcostmanagement/zz_generated_models.go b/sdk/resourcemanager/costmanagement/armcostmanagement/zz_generated_models.go index c67b0ab73fc6..9ba5a9006989 100644 --- a/sdk/resourcemanager/costmanagement/armcostmanagement/zz_generated_models.go +++ b/sdk/resourcemanager/costmanagement/armcostmanagement/zz_generated_models.go @@ -321,7 +321,6 @@ type ErrorDetails struct { // * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" // header. // -// // * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" // header. type ErrorResponse struct { @@ -666,11 +665,9 @@ type GenerateDetailedCostReportDefinition struct { // * 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the maximum // size permitted of 2Gb. Please utilize our Exports feature instead. // -// // * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" // header. // -// // * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" // header. type GenerateDetailedCostReportErrorResponse struct { diff --git a/sdk/resourcemanager/datafactory/armdatafactory/dataflowdebugsession_client_example_test.go b/sdk/resourcemanager/datafactory/armdatafactory/dataflowdebugsession_client_example_test.go index 9ebcead07c5a..27b46f85c24b 100644 --- a/sdk/resourcemanager/datafactory/armdatafactory/dataflowdebugsession_client_example_test.go +++ b/sdk/resourcemanager/datafactory/armdatafactory/dataflowdebugsession_client_example_test.go @@ -109,7 +109,7 @@ func ExampleDataFlowDebugSessionClient_AddDataFlow() { Type: to.Ptr("MappingDataFlow"), TypeProperties: &armdatafactory.MappingDataFlowTypeProperties{ Script: to.Ptr("\n\nsource(output(\n Column_1 as string\n ),\n allowSchemaDrift: true,\n validateSchema: false) ~> source1"), - Sinks: []*armdatafactory.DataFlowSink{}, + Sinks: []*armdatafactory.DataFlowSink{}, Sources: []*armdatafactory.DataFlowSource{ { Name: to.Ptr("source1"), diff --git a/sdk/resourcemanager/resources/armpolicy/zz_generated_assignments_client.go b/sdk/resourcemanager/resources/armpolicy/zz_generated_assignments_client.go index 18ce11e1c394..2625aa661631 100644 --- a/sdk/resourcemanager/resources/armpolicy/zz_generated_assignments_client.go +++ b/sdk/resourcemanager/resources/armpolicy/zz_generated_assignments_client.go @@ -372,7 +372,7 @@ func (client *AssignmentsClient) getByIDHandleResponse(resp *http.Response) (Ass // NewListPager - This operation retrieves the list of all policy assignments associated with the given subscription that // match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or -// 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated +// 'policyDefinitionId eq '{value}”. If $filter is not provided, the unfiltered list includes all policy assignments associated // with the subscription, including those that apply directly or from // management groups that contain the given subscription, as well as any applied to objects contained within the subscription. // If $filter=atScope() is provided, the returned list includes all policy @@ -449,7 +449,7 @@ func (client *AssignmentsClient) listHandleResponse(resp *http.Response) (Assign // NewListForManagementGroupPager - This operation retrieves the list of all policy assignments applicable to the management // group that match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or -// 'policyDefinitionId eq '{value}''. If $filter=atScope() is provided, the returned list includes all policy assignments +// 'policyDefinitionId eq '{value}”. If $filter=atScope() is provided, the returned list includes all policy assignments // that are assigned to the management group or the management group's ancestors. If // $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the management group. // If $filter=policyDefinitionId eq '{value}' is provided, the returned list @@ -524,7 +524,7 @@ func (client *AssignmentsClient) listForManagementGroupHandleResponse(resp *http // NewListForResourcePager - This operation retrieves the list of all policy assignments associated with the specified resource // in the given resource group and subscription that match the optional given $filter. Valid values for -// $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered +// $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}”. If $filter is not provided, the unfiltered // list includes all policy assignments associated with the resource, including // those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. // If $filter=atScope() is provided, the returned list includes all policy @@ -534,14 +534,14 @@ func (client *AssignmentsClient) listForManagementGroupHandleResponse(resp *http // the returned list includes all policy assignments of the policy definition // whose id is {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific // resource. If the resource is not part of a parent resource (the more common -// case), the parent resource path should not be provided (or provided as ''). For example a web app could be specified as -// ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', +// case), the parent resource path should not be provided (or provided as ”). For example a web app could be specified as +// ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == ”, // {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters // should be provided. For example a virtual machine DNS name could be // specified as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', // {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A // convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, -// format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', +// format: ({resourceProviderNamespace} == ”, {parentResourcePath} == ”, // {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-06-01 @@ -632,7 +632,7 @@ func (client *AssignmentsClient) listForResourceHandleResponse(resp *http.Respon // NewListForResourceGroupPager - This operation retrieves the list of all policy assignments associated with the given resource // group in the given subscription that match the optional given $filter. Valid values for $filter are: -// 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes +// 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}”. If $filter is not provided, the unfiltered list includes // all policy assignments associated with the resource group, including those // that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource // group. If $filter=atScope() is provided, the returned list includes all policy diff --git a/sdk/resourcemanager/resources/armpolicy/zz_generated_definitions_client.go b/sdk/resourcemanager/resources/armpolicy/zz_generated_definitions_client.go index a5c8db4024bc..0a9edaab1126 100644 --- a/sdk/resourcemanager/resources/armpolicy/zz_generated_definitions_client.go +++ b/sdk/resourcemanager/resources/armpolicy/zz_generated_definitions_client.go @@ -402,7 +402,7 @@ func (client *DefinitionsClient) getBuiltInHandleResponse(resp *http.Response) ( // NewListPager - This operation retrieves a list of all the policy definitions in a given subscription that match the optional // given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or -// 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with +// 'category eq '{value}”. If $filter is not provided, the unfiltered list includes all policy definitions associated with // the subscription, including those that apply directly or from management groups // that contain the given subscription. If $filter=atExactScope() is provided, the returned list only includes all policy // definitions that at the given subscription. If $filter='policyType -eq {value}' @@ -544,7 +544,7 @@ func (client *DefinitionsClient) listBuiltInHandleResponse(resp *http.Response) // NewListByManagementGroupPager - This operation retrieves a list of all the policy definitions in a given management group // that match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq -// {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated +// {value}' or 'category eq '{value}”. If $filter is not provided, the unfiltered list includes all policy definitions associated // with the management group, including those that apply directly or from // management groups that contain the given management group. If $filter=atExactScope() is provided, the returned list only // includes all policy definitions that at the given management group. If diff --git a/sdk/resourcemanager/resources/armpolicy/zz_generated_exemptions_client.go b/sdk/resourcemanager/resources/armpolicy/zz_generated_exemptions_client.go index 497dd100bc82..6398c181f58d 100644 --- a/sdk/resourcemanager/resources/armpolicy/zz_generated_exemptions_client.go +++ b/sdk/resourcemanager/resources/armpolicy/zz_generated_exemptions_client.go @@ -213,7 +213,7 @@ func (client *ExemptionsClient) getHandleResponse(resp *http.Response) (Exemptio // NewListPager - This operation retrieves the list of all policy exemptions associated with the given subscription that match // the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', -// 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy +// 'excludeExpired()' or 'policyAssignmentId eq '{value}”. If $filter is not provided, the unfiltered list includes all policy // exemptions associated with the subscription, including those that apply // directly or from management groups that contain the given subscription, as well as any applied to objects contained within // the subscription. @@ -282,7 +282,7 @@ func (client *ExemptionsClient) listHandleResponse(resp *http.Response) (Exempti // NewListForManagementGroupPager - This operation retrieves the list of all policy exemptions applicable to the management // group that match the given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()', -// 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter=atScope() is provided, the returned list includes all +// 'excludeExpired()' or 'policyAssignmentId eq '{value}”. If $filter=atScope() is provided, the returned list includes all // policy exemptions that are assigned to the management group or the management // group's ancestors. // If the operation fails it returns an *azcore.ResponseError type. @@ -352,19 +352,19 @@ func (client *ExemptionsClient) listForManagementGroupHandleResponse(resp *http. // NewListForResourcePager - This operation retrieves the list of all policy exemptions associated with the specified resource // in the given resource group and subscription that match the optional given $filter. Valid values for -// $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not +// $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}”. If $filter is not // provided, the unfiltered list includes all policy exemptions associated with the // resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained // within the resource. Three parameters plus the resource name are used to // identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource -// path should not be provided (or provided as ''). For example a web app could -// be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', +// path should not be provided (or provided as ”). For example a web app could +// be specified as ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == ”, {resourceType} == 'sites', // {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, // then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} // == 'Microsoft.Compute', {parentResourcePath} == // 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient // alternative to providing the namespace and type name separately is to provide -// both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} +// both in the {resourceType} parameter, format: ({resourceProviderNamespace} == ”, {parentResourcePath} == ”, {resourceType} // == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-07-01-preview @@ -452,7 +452,7 @@ func (client *ExemptionsClient) listForResourceHandleResponse(resp *http.Respons // NewListForResourceGroupPager - This operation retrieves the list of all policy exemptions associated with the given resource // group in the given subscription that match the optional given $filter. Valid values for $filter are: -// 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. If $filter is not provided, the +// 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}”. If $filter is not provided, the // unfiltered list includes all policy exemptions associated with the resource // group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained // within the resource group. diff --git a/sdk/resourcemanager/resources/armpolicy/zz_generated_setdefinitions_client.go b/sdk/resourcemanager/resources/armpolicy/zz_generated_setdefinitions_client.go index 1106c296db21..0a3c0aa8498f 100644 --- a/sdk/resourcemanager/resources/armpolicy/zz_generated_setdefinitions_client.go +++ b/sdk/resourcemanager/resources/armpolicy/zz_generated_setdefinitions_client.go @@ -405,7 +405,7 @@ func (client *SetDefinitionsClient) getBuiltInHandleResponse(resp *http.Response // NewListPager - This operation retrieves a list of all the policy set definitions in a given subscription that match the // optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq -// {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions +// {value}' or 'category eq '{value}”. If $filter is not provided, the unfiltered list includes all policy set definitions // associated with the subscription, including those that apply directly or from // management groups that contain the given subscription. If $filter=atExactScope() is provided, the returned list only includes // all policy set definitions that at the given subscription. If @@ -547,7 +547,7 @@ func (client *SetDefinitionsClient) listBuiltInHandleResponse(resp *http.Respons // NewListByManagementGroupPager - This operation retrieves a list of all the policy set definitions in a given management // group that match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq -// {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions +// {value}' or 'category eq '{value}”. If $filter is not provided, the unfiltered list includes all policy set definitions // associated with the management group, including those that apply directly or // from management groups that contain the given management group. If $filter=atExactScope() is provided, the returned list // only includes all policy set definitions that at the given management group. If diff --git a/sdk/samples/azidentity/manual-tests/managed-identity/functions/handler.go b/sdk/samples/azidentity/manual-tests/managed-identity/functions/handler.go index db3e36ceb2ee..331ac41258c8 100644 --- a/sdk/samples/azidentity/manual-tests/managed-identity/functions/handler.go +++ b/sdk/samples/azidentity/manual-tests/managed-identity/functions/handler.go @@ -24,8 +24,8 @@ func handler(w http.ResponseWriter, r *http.Request) { if id, ok := os.LookupEnv("AZURE_IDENTITY_TEST_MANAGED_IDENTITY_CLIENT_ID"); ok { o.ID = azidentity.ClientID(id) } - var err error - var client *azsecrets.Client + var err error + var client *azsecrets.Client cred, err := azidentity.NewManagedIdentityCredential(&o) if err == nil { client, err = azsecrets.NewClient(v, cred, nil) @@ -39,9 +39,9 @@ func handler(w http.ResponseWriter, r *http.Request) { } } } - if err == nil { - fmt.Fprint(w, "test passed") - } else { + if err == nil { + fmt.Fprint(w, "test passed") + } else { fmt.Fprintf(w, "test failed: %s", err.Error()) } } diff --git a/sdk/storage/azblob/constants.go b/sdk/storage/azblob/constants.go index c1c336ed4665..5d70de4e8b61 100644 --- a/sdk/storage/azblob/constants.go +++ b/sdk/storage/azblob/constants.go @@ -8,7 +8,7 @@ package azblob var SASVersion = "2019-12-12" -//nolint +// nolint const ( // BlockBlobMaxUploadBlobBytes indicates the maximum number of bytes that can be sent in a call to Upload. BlockBlobMaxUploadBlobBytes = 256 * 1024 * 1024 // 256MB diff --git a/sdk/storage/azblob/zc_blob_client.go b/sdk/storage/azblob/zc_blob_client.go index 9543d14f8776..a8af29062790 100644 --- a/sdk/storage/azblob/zc_blob_client.go +++ b/sdk/storage/azblob/zc_blob_client.go @@ -57,7 +57,7 @@ func NewBlobClientWithSharedKey(blobURL string, cred *SharedKeyCredential, optio } // NewBlobClientFromConnectionString creates BlobClient from a connection String -//nolint +// nolint func NewBlobClientFromConnectionString(connectionString, containerName, blobName string, options *ClientOptions) (*BlobClient, error) { containerClient, err := NewContainerClientFromConnectionString(connectionString, containerName, options) if err != nil { diff --git a/sdk/storage/azblob/zc_blob_lease_client.go b/sdk/storage/azblob/zc_blob_lease_client.go index a9273dfb62cd..5601926a36a5 100644 --- a/sdk/storage/azblob/zc_blob_lease_client.go +++ b/sdk/storage/azblob/zc_blob_lease_client.go @@ -36,7 +36,7 @@ func (b *BlobClient) NewBlobLeaseClient(leaseID *string) (*BlobLeaseClient, erro } // AcquireLease acquires a lease on the blob for write and delete operations. -//The lease Duration must be between 15 and 60 seconds, or infinite (-1). +// The lease Duration must be between 15 and 60 seconds, or infinite (-1). // For more information, see https://docs.microsoft.com/rest/api/storageservices/lease-blob. func (blc *BlobLeaseClient) AcquireLease(ctx context.Context, options *BlobAcquireLeaseOptions) (BlobAcquireLeaseResponse, error) { blobAcquireLeaseOptions, modifiedAccessConditions := options.format() diff --git a/sdk/storage/azblob/zc_container_lease_client.go b/sdk/storage/azblob/zc_container_lease_client.go index 395a72a89aaa..66f1ec0b5000 100644 --- a/sdk/storage/azblob/zc_container_lease_client.go +++ b/sdk/storage/azblob/zc_container_lease_client.go @@ -14,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid" ) -//ContainerLeaseClient represents lease client of container +// ContainerLeaseClient represents lease client of container type ContainerLeaseClient struct { ContainerClient leaseID *string diff --git a/sdk/storage/azblob/zc_service_client.go b/sdk/storage/azblob/zc_service_client.go index e75dd10b31e7..16568798e7b1 100644 --- a/sdk/storage/azblob/zc_service_client.go +++ b/sdk/storage/azblob/zc_service_client.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) -//nolint +// nolint const ( // ContainerNameRoot is the special Azure Storage name used to identify a storage account's root container. ContainerNameRoot = "$root" @@ -77,7 +77,7 @@ func NewServiceClientWithSharedKey(serviceURL string, cred *SharedKeyCredential, } // NewServiceClientFromConnectionString creates a service client from the given connection string. -//nolint +// nolint func NewServiceClientFromConnectionString(connectionString string, options *ClientOptions) (*ServiceClient, error) { endpoint, credential, err := parseConnectionString(connectionString) if err != nil { diff --git a/sdk/storage/azblob/zc_storage_error.go b/sdk/storage/azblob/zc_storage_error.go index 08c9c8730909..94c8c0d8a980 100644 --- a/sdk/storage/azblob/zc_storage_error.go +++ b/sdk/storage/azblob/zc_storage_error.go @@ -160,7 +160,7 @@ func (e StorageError) Response() *http.Response { return e.response } -//nolint +// nolint func writeRequestWithResponse(b *bytes.Buffer, request *policy.Request, response *http.Response) { // Write the request into the buffer. _, _ = fmt.Fprint(b, " "+request.Raw().Method+" "+request.Raw().URL.String()+"\n") @@ -173,7 +173,7 @@ func writeRequestWithResponse(b *bytes.Buffer, request *policy.Request, response } // formatHeaders appends an HTTP request's or response's header into a Buffer. -//nolint +// nolint func writeHeader(b *bytes.Buffer, header map[string][]string) { if len(header) == 0 { b.WriteString(" (no headers)\n") @@ -207,7 +207,7 @@ func (e *StorageError) Temporary() bool { } // UnmarshalXML performs custom unmarshalling of XML-formatted Azure storage request errors. -//nolint +// nolint func (e *StorageError) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) { tokName := "" var t xml.Token diff --git a/sdk/storage/azblob/zc_storage_error_test.go b/sdk/storage/azblob/zc_storage_error_test.go index 86d0d05df666..728e3ffcb320 100644 --- a/sdk/storage/azblob/zc_storage_error_test.go +++ b/sdk/storage/azblob/zc_storage_error_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" ) -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestErrorResponseUnmarshal() { t := s.T() diff --git a/sdk/storage/azblob/zm_container_client_util.go b/sdk/storage/azblob/zm_container_client_util.go index a33103e4b77c..d2b4a7e33731 100644 --- a/sdk/storage/azblob/zm_container_client_util.go +++ b/sdk/storage/azblob/zm_container_client_util.go @@ -225,7 +225,7 @@ func toContainerListBlobFlatSegmentPager(resp *containerClientListBlobFlatSegmen // --------------------------------------------------------------------------------------------------------------------- -//ContainerListBlobsHierarchyOptions provides set of configurations for ContainerClient.ListBlobsHierarchy +// ContainerListBlobsHierarchyOptions provides set of configurations for ContainerClient.ListBlobsHierarchy type ContainerListBlobsHierarchyOptions struct { // Include this parameter to specify one or more datasets to include in the response. Include []ListBlobsIncludeItem diff --git a/sdk/storage/azblob/zt_access_policy_test.go b/sdk/storage/azblob/zt_access_policy_test.go index d84a9b704de4..94d44278efa5 100644 --- a/sdk/storage/azblob/zt_access_policy_test.go +++ b/sdk/storage/azblob/zt_access_policy_test.go @@ -12,7 +12,7 @@ import ( "time" ) -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSetEmptyAccessPolicy() { _require := require.New(s.T()) testName := s.T().Name() @@ -29,7 +29,7 @@ func (s *azblobUnrecordedTestSuite) TestSetEmptyAccessPolicy() { _require.Nil(err) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSetAccessPolicy() { _require := require.New(s.T()) testName := s.T().Name() @@ -66,7 +66,7 @@ func (s *azblobUnrecordedTestSuite) TestSetAccessPolicy() { _require.Nil(err) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSetMultipleAccessPolicies() { _require := require.New(s.T()) testName := s.T().Name() @@ -123,7 +123,7 @@ func (s *azblobUnrecordedTestSuite) TestSetMultipleAccessPolicies() { _require.Len(resp.SignedIdentifiers, 3) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSetNullAccessPolicy() { _require := require.New(s.T()) testName := s.T().Name() diff --git a/sdk/storage/azblob/zt_append_blob_client_test.go b/sdk/storage/azblob/zt_append_blob_client_test.go index 7b8ba615157f..f2bd2cc9b76d 100644 --- a/sdk/storage/azblob/zt_append_blob_client_test.go +++ b/sdk/storage/azblob/zt_append_blob_client_test.go @@ -18,7 +18,7 @@ import ( "time" ) -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestAppendBlock() { _require := require.New(s.T()) testName := s.T().Name() @@ -58,7 +58,7 @@ func (s *azblobUnrecordedTestSuite) TestAppendBlock() { _require.Equal(*appendResp.BlobCommittedBlockCount, int32(2)) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestAppendBlockWithMD5() { _require := require.New(s.T()) testName := s.T().Name() @@ -112,7 +112,7 @@ func (s *azblobUnrecordedTestSuite) TestAppendBlockWithMD5() { validateStorageError(_require, err, StorageErrorCodeMD5Mismatch) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestAppendBlockFromURL() { _require := require.New(s.T()) testName := s.T().Name() @@ -208,7 +208,7 @@ func (s *azblobUnrecordedTestSuite) TestAppendBlockFromURL() { _ = downloadResp.Body(nil).Close() } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestAppendBlockFromURLWithMD5() { _require := require.New(s.T()) testName := s.T().Name() diff --git a/sdk/storage/azblob/zt_blob_client_test.go b/sdk/storage/azblob/zt_blob_client_test.go index 473bc0042402..4620178ce64e 100644 --- a/sdk/storage/azblob/zt_blob_client_test.go +++ b/sdk/storage/azblob/zt_blob_client_test.go @@ -384,7 +384,7 @@ func (s *azblobTestSuite) TestBlobStartCopySourcePrivate() { validateStorageError(_require, err, StorageErrorCodeCannotVerifyCopySource) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobStartCopyUsingSASSrc() { _require := require.New(s.T()) testName := s.T().Name() @@ -460,7 +460,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobStartCopyUsingSASSrc() { _ = resp2.Body(nil).Close() } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobStartCopyUsingSASDest() { _require := require.New(s.T()) testName := s.T().Name() @@ -1020,7 +1020,7 @@ func (s *azblobTestSuite) TestBlobStartCopyDestIfNoneMatchFalse() { validateStorageError(_require, err, StorageErrorCodeTargetConditionNotMet) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobAbortCopyInProgress() { _require := require.New(s.T()) testName := s.T().Name() @@ -3212,7 +3212,7 @@ func (s *azblobTestSuite) TestBlobSetMetadataIfNoneMatchFalse() { validateStorageError(_require, err, StorageErrorCodeConditionNotMet) } -//nolint +// nolint func testBlobServiceClientDeleteImpl(_ *require.Assertions, _ *ServiceClient) error { //containerClient := createNewContainer(_require, "gocblobserviceclientdeleteimpl", svcClient) //defer deleteContainer(_require, containerClient) @@ -3438,7 +3438,7 @@ func (s *azblobTestSuite) TestBlobClientPartsSASQueryTimes() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestDownloadBlockBlobUnexpectedEOF() { _require := require.New(s.T()) testName := s.T().Name() @@ -3472,7 +3472,7 @@ func (s *azblobUnrecordedTestSuite) TestDownloadBlockBlobUnexpectedEOF() { _require.EqualValues(buf, []byte(blockBlobDefaultData)) } -//nolint +// nolint func InjectErrorInRetryReaderOptions(err error) *RetryReaderOptions { return &RetryReaderOptions{ MaxRetryRequests: 1, diff --git a/sdk/storage/azblob/zt_blob_tags_test.go b/sdk/storage/azblob/zt_blob_tags_test.go index 54a5b99bd320..33b97f8119d4 100644 --- a/sdk/storage/azblob/zt_blob_tags_test.go +++ b/sdk/storage/azblob/zt_blob_tags_test.go @@ -18,7 +18,7 @@ import ( "time" ) -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSetBlobTags() { _require := require.New(s.T()) testName := s.T().Name() @@ -62,7 +62,7 @@ func (s *azblobUnrecordedTestSuite) TestSetBlobTags() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSetBlobTagsWithVID() { _require := require.New(s.T()) testName := s.T().Name() @@ -120,7 +120,7 @@ func (s *azblobUnrecordedTestSuite) TestSetBlobTagsWithVID() { _require.Nil(blobGetTagsResponse.BlobTagSet) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadBlockBlobWithSpecialCharactersInTags() { _require := require.New(s.T()) testName := s.T().Name() @@ -160,7 +160,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadBlockBlobWithSpecialCharactersInTa } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestStageBlockWithTags() { _require := require.New(s.T()) testName := s.T().Name() @@ -227,7 +227,7 @@ func (s *azblobUnrecordedTestSuite) TestStageBlockWithTags() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestStageBlockFromURLWithTags() { _require := require.New(s.T()) testName := s.T().Name() @@ -336,7 +336,7 @@ func (s *azblobUnrecordedTestSuite) TestStageBlockFromURLWithTags() { _require.EqualValues(destData, sourceData) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestCopyBlockBlobFromURLWithTags() { _require := require.New(s.T()) testName := s.T().Name() @@ -425,7 +425,7 @@ func (s *azblobUnrecordedTestSuite) TestCopyBlockBlobFromURLWithTags() { _require.Equal(resp.RawResponse.StatusCode, 202) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestGetPropertiesReturnsTagsCount() { _require := require.New(s.T()) testName := s.T().Name() @@ -460,7 +460,7 @@ func (s *azblobUnrecordedTestSuite) TestGetPropertiesReturnsTagsCount() { _require.Equal(*downloadResp.TagCount, int64(3)) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSetBlobTagForSnapshot() { _require := require.New(s.T()) testName := s.T().Name() @@ -496,7 +496,7 @@ func (s *azblobUnrecordedTestSuite) TestSetBlobTagForSnapshot() { } // TODO: Once new pacer is done. -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestListBlobReturnsTags() { _require := require.New(s.T()) testName := s.T().Name() @@ -750,7 +750,7 @@ func (s *azblobUnrecordedTestSuite) TestCreatePageBlobWithTags() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestPageBlobSetBlobTagForSnapshot() { _require := require.New(s.T()) testName := s.T().Name() @@ -789,7 +789,7 @@ func (s *azblobUnrecordedTestSuite) TestPageBlobSetBlobTagForSnapshot() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestCreateAppendBlobWithTags() { _require := require.New(s.T()) testName := s.T().Name() diff --git a/sdk/storage/azblob/zt_blob_versioning_test.go b/sdk/storage/azblob/zt_blob_versioning_test.go index be031f52d557..9282a0d7eeaa 100644 --- a/sdk/storage/azblob/zt_blob_versioning_test.go +++ b/sdk/storage/azblob/zt_blob_versioning_test.go @@ -161,115 +161,115 @@ func (s *azblobTestSuite) TestCreateAndDownloadBlobSpecialCharactersWithVID() { } } -//func (s *azblobTestSuite) TestDeleteSpecificBlobVersion() { -// _require := require.New(s.T()) -// testName := s.T().Name() -// -// _context := getTestContext(testName) -// svcClient, err := getServiceClient(_context.recording, testAccountDefault, nil) -// if err != nil { -// s.Fail("Unable to fetch service client because " + err.Error()) -// } -// -// containerName := generateContainerName(testName) -// containerClient := createNewContainer(_require, containerName, svcClient) -// defer deleteContainer(_require, containerClient) -// blobURL := getBlockBlobClient(generateBlobName(testName), containerClient) -// -// uploadResp, err := blobURL.Upload(ctx, internal.NopCloser(bytes.NewReader([]byte("data"))), &BlockBlobUploadOptions{ -// Metadata: basicMetadata, -// }) -// _require.Nil(err) -// _require.NotNil(uploadResp.VersionID) -// versionID1 := uploadResp.VersionID -// -// uploadResp, err = blobURL.Upload(ctx, internal.NopCloser(bytes.NewReader([]byte("updated_data"))),, &BlockBlobUploadOptions{ -// Metadata: basicMetadata, -// }) -// _require.Nil(err) -// _require.NotNil(uploadResp.VersionID) -// -// listPager := containerClient.ListBlobsFlat(&ContainerListBlobsFlatOptions{ -// Include: &[]ListBlobsIncludeItem{ListBlobsIncludeItemVersions}, -// }) +// func (s *azblobTestSuite) TestDeleteSpecificBlobVersion() { +// _require := require.New(s.T()) +// testName := s.T().Name() +// +// _context := getTestContext(testName) +// svcClient, err := getServiceClient(_context.recording, testAccountDefault, nil) +// if err != nil { +// s.Fail("Unable to fetch service client because " + err.Error()) +// } // -// count := 0 -// blobs -// for listPager.NextPage(ctx) { -// resp := listPager.PageResponse() -// for _, blob := range resp.EnumerationResults.Segment.BlobItems { -// count += 1; -// // Process the blobs returned -// snapTime := "N/A" -// if blob.Snapshot != nil { -// snapTime = *blob.Snapshot +// containerName := generateContainerName(testName) +// containerClient := createNewContainer(_require, containerName, svcClient) +// defer deleteContainer(_require, containerClient) +// blobURL := getBlockBlobClient(generateBlobName(testName), containerClient) +// +// uploadResp, err := blobURL.Upload(ctx, internal.NopCloser(bytes.NewReader([]byte("data"))), &BlockBlobUploadOptions{ +// Metadata: basicMetadata, +// }) +// _require.Nil(err) +// _require.NotNil(uploadResp.VersionID) +// versionID1 := uploadResp.VersionID +// +// uploadResp, err = blobURL.Upload(ctx, internal.NopCloser(bytes.NewReader([]byte("updated_data"))),, &BlockBlobUploadOptions{ +// Metadata: basicMetadata, +// }) +// _require.Nil(err) +// _require.NotNil(uploadResp.VersionID) +// +// listPager := containerClient.ListBlobsFlat(&ContainerListBlobsFlatOptions{ +// Include: &[]ListBlobsIncludeItem{ListBlobsIncludeItemVersions}, +// }) +// +// count := 0 +// blobs +// for listPager.NextPage(ctx) { +// resp := listPager.PageResponse() +// for _, blob := range resp.EnumerationResults.Segment.BlobItems { +// count += 1; +// // Process the blobs returned +// snapTime := "N/A" +// if blob.Snapshot != nil { +// snapTime = *blob.Snapshot +// } +// fmt.Printf("Blob name: %s, Snapshot: %s\n", *blob.Name, snapTime) // } -// fmt.Printf("Blob name: %s, Snapshot: %s\n", *blob.Name, snapTime) // } -// } -// _require.Nil(listPager.Err()) -// _require.Len(count, 2) -// -// // Deleting previous version snapshot. -// deleteResp, err := blobURL.WithVersionID(versionID1).Delete(ctx, DeleteSnapshotsOptionNone, BlobAccessConditions{}) -// _require.Nil(err) -// _assert(deleteResp.StatusCode(), chk.Equals, 202) -// -// listBlobsResp, err = containerClient.ListBlobsFlat(ctx, Marker{}, ListBlobsSegmentOptions{Details: BlobListingDetails{Versions: true}}) -// _require.Nil(err) -// _assert(listBlobsResp.Segment.BlobItems, chk.NotNil) -// if len(listBlobsResp.Segment.BlobItems) != 1 { -// s.T().Fail() -// } -//} -// -//func (s *azblobTestSuite) TestDeleteSpecificBlobVersionWithBlobSAS() { -// _require := require.New(s.T()) -// testName := s.T().Name() -// -// _context := getTestContext(testName) -// svcClient, err := getServiceClient(_context.recording, testAccountDefault, nil) -// if err != nil { -// s.Fail("Unable to fetch service client because " + err.Error()) +// _require.Nil(listPager.Err()) +// _require.Len(count, 2) +// +// // Deleting previous version snapshot. +// deleteResp, err := blobURL.WithVersionID(versionID1).Delete(ctx, DeleteSnapshotsOptionNone, BlobAccessConditions{}) +// _require.Nil(err) +// _assert(deleteResp.StatusCode(), chk.Equals, 202) +// +// listBlobsResp, err = containerClient.ListBlobsFlat(ctx, Marker{}, ListBlobsSegmentOptions{Details: BlobListingDetails{Versions: true}}) +// _require.Nil(err) +// _assert(listBlobsResp.Segment.BlobItems, chk.NotNil) +// if len(listBlobsResp.Segment.BlobItems) != 1 { +// s.T().Fail() +// } // } // -// containerName := generateContainerName(testName) -// containerClient := createNewContainer(_require, containerName, svcClient) -// defer deleteContainer(_require, containerClient) -// blobURL, blobName := getBlockBlobClient(c, containerClient) +// func (s *azblobTestSuite) TestDeleteSpecificBlobVersionWithBlobSAS() { +// _require := require.New(s.T()) +// testName := s.T().Name() // -// resp, err := blobURL.Upload(ctx, internal.NopCloser(bytes.NewReader([]byte("data"))), HTTPHeaders{}, basicMetadata, BlobAccessConditions{}, DefaultAccessTier, nil, ClientProvidedKeyOptions{}) -// _require.Nil(err) -// versionId := resp.VersionID -// _assert(versionId, chk.NotNil) -// -// resp, err = blobURL.Upload(ctx, internal.NopCloser(bytes.NewReader([]byte("updated_data"))),, HTTPHeaders{}, basicMetadata, BlobAccessConditions{}, DefaultAccessTier, nil, ClientProvidedKeyOptions{}) -// _require.Nil(err) -// _assert(resp.VersionID, chk.NotNil) +// _context := getTestContext(testName) +// svcClient, err := getServiceClient(_context.recording, testAccountDefault, nil) +// if err != nil { +// s.Fail("Unable to fetch service client because " + err.Error()) +// } // -// blobParts := NewBlobURLParts(blobURL.URL()) -// blobParts.VersionID = versionId -// blobParts.SAS, err = BlobSASSignatureValues{ -// Protocol: SASProtocolHTTPS, -// ExpiryTime: time.Now().UTC().Add(1 * time.Hour), -// ContainerName: containerName, -// BlobName: blobName, -// Permissions: BlobSASPermissions{Delete: true, DeletePreviousVersion: true}.String(), -// }.NewSASQueryParameters(credential) -// if err != nil { -// s.T().Fatal(err) -// } +// containerName := generateContainerName(testName) +// containerClient := createNewContainer(_require, containerName, svcClient) +// defer deleteContainer(_require, containerClient) +// blobURL, blobName := getBlockBlobClient(c, containerClient) +// +// resp, err := blobURL.Upload(ctx, internal.NopCloser(bytes.NewReader([]byte("data"))), HTTPHeaders{}, basicMetadata, BlobAccessConditions{}, DefaultAccessTier, nil, ClientProvidedKeyOptions{}) +// _require.Nil(err) +// versionId := resp.VersionID +// _assert(versionId, chk.NotNil) +// +// resp, err = blobURL.Upload(ctx, internal.NopCloser(bytes.NewReader([]byte("updated_data"))),, HTTPHeaders{}, basicMetadata, BlobAccessConditions{}, DefaultAccessTier, nil, ClientProvidedKeyOptions{}) +// _require.Nil(err) +// _assert(resp.VersionID, chk.NotNil) +// +// blobParts := NewBlobURLParts(blobURL.URL()) +// blobParts.VersionID = versionId +// blobParts.SAS, err = BlobSASSignatureValues{ +// Protocol: SASProtocolHTTPS, +// ExpiryTime: time.Now().UTC().Add(1 * time.Hour), +// ContainerName: containerName, +// BlobName: blobName, +// Permissions: BlobSASPermissions{Delete: true, DeletePreviousVersion: true}.String(), +// }.NewSASQueryParameters(credential) +// if err != nil { +// s.T().Fatal(err) +// } // -// sbURL := NewBlockBlobClient(blobParts.URL(), containerClient.client.p) -// deleteResp, err := sbURL.Delete(ctx, DeleteSnapshotsOptionNone, BlobAccessConditions{}) -// _assert(deleteResp, chk.IsNil) +// sbURL := NewBlockBlobClient(blobParts.URL(), containerClient.client.p) +// deleteResp, err := sbURL.Delete(ctx, DeleteSnapshotsOptionNone, BlobAccessConditions{}) +// _assert(deleteResp, chk.IsNil) // -// listBlobResp, err := containerClient.ListBlobsFlat(ctx, Marker{}, ListBlobsSegmentOptions{Details: BlobListingDetails{Versions: true}}) -// _require.Nil(err) -// for _, blob := range listBlobResp.Segment.BlobItems { -// _assert(blob.VersionID, chk.Not(chk.Equals), versionId) +// listBlobResp, err := containerClient.ListBlobsFlat(ctx, Marker{}, ListBlobsSegmentOptions{Details: BlobListingDetails{Versions: true}}) +// _require.Nil(err) +// for _, blob := range listBlobResp.Segment.BlobItems { +// _assert(blob.VersionID, chk.Not(chk.Equals), versionId) +// } // } -//} func (s *azblobTestSuite) TestDeleteSpecificBlobVersion() { _require := require.New(s.T()) testName := s.T().Name() @@ -499,7 +499,7 @@ func (s *azblobTestSuite) TestPutBlockListReturnsVID() { _require.EqualValues(contentData, []uint8(strings.Join(data, ""))) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestCreateBlockBlobReturnsVID() { _require := require.New(s.T()) testName := s.T().Name() diff --git a/sdk/storage/azblob/zt_block_blob_client_test.go b/sdk/storage/azblob/zt_block_blob_client_test.go index ff02ac9e2615..944ed6005ed3 100644 --- a/sdk/storage/azblob/zt_block_blob_client_test.go +++ b/sdk/storage/azblob/zt_block_blob_client_test.go @@ -99,7 +99,7 @@ func (s *azblobTestSuite) TestStageGetBlocks() { _require.Len(blockList.BlockList.CommittedBlocks, len(data)) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestStageBlockFromURL() { _require := require.New(s.T()) testName := s.T().Name() @@ -198,7 +198,7 @@ func (s *azblobUnrecordedTestSuite) TestStageBlockFromURL() { _require.EqualValues(destData, content) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestCopyBlockBlobFromURL() { _require := require.New(s.T()) testName := s.T().Name() @@ -294,7 +294,7 @@ func (s *azblobUnrecordedTestSuite) TestCopyBlockBlobFromURL() { _require.EqualValues(*resp.CopyStatus, "success") } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobSASQueryParamOverrideResponseHeaders() { _require := require.New(s.T()) testName := s.T().Name() @@ -362,7 +362,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobSASQueryParamOverrideResponseHeaders _require.Equal(*gResp.ContentType, contentTypeVal) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestStageBlockWithMD5() { _require := require.New(s.T()) testName := s.T().Name() @@ -1144,7 +1144,7 @@ func (s *azblobTestSuite) TestBlobSetTierOnCommit() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSetTierOnCopyBlockBlobFromURL() { _require := require.New(s.T()) testName := s.T().Name() @@ -1208,7 +1208,7 @@ func (s *azblobUnrecordedTestSuite) TestSetTierOnCopyBlockBlobFromURL() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSetTierOnStageBlockFromURL() { _require := require.New(s.T()) testName := s.T().Name() diff --git a/sdk/storage/azblob/zt_bytes_writer_test.go b/sdk/storage/azblob/zt_bytes_writer_test.go index 1c90b2b3c840..261d44b3cc9f 100644 --- a/sdk/storage/azblob/zt_bytes_writer_test.go +++ b/sdk/storage/azblob/zt_bytes_writer_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" ) -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBytesWriterWriteAt() { _require := require.New(s.T()) b := make([]byte, 10) diff --git a/sdk/storage/azblob/zt_chunkwriting_test.go b/sdk/storage/azblob/zt_chunkwriting_test.go index cee6288198eb..176c8e79f450 100644 --- a/sdk/storage/azblob/zt_chunkwriting_test.go +++ b/sdk/storage/azblob/zt_chunkwriting_test.go @@ -24,14 +24,14 @@ import ( const finalFileName = "final" -//nolint +// nolint type fakeBlockWriter struct { path string block int32 errOnBlock int32 } -//nolint +// nolint func newFakeBlockWriter() *fakeBlockWriter { generatedUuid, _ := uuid.New() f := &fakeBlockWriter{ @@ -47,7 +47,7 @@ func newFakeBlockWriter() *fakeBlockWriter { return f } -//nolint +// nolint func (f *fakeBlockWriter) StageBlock(_ context.Context, blockID string, body io.ReadSeekCloser, _ *BlockBlobStageBlockOptions) (BlockBlobStageBlockResponse, error) { n := atomic.AddInt32(&f.block, 1) if n == f.errOnBlock { @@ -71,7 +71,7 @@ func (f *fakeBlockWriter) StageBlock(_ context.Context, blockID string, body io. return BlockBlobStageBlockResponse{}, nil } -//nolint +// nolint func (f *fakeBlockWriter) CommitBlockList(_ context.Context, base64BlockIDs []string, _ *BlockBlobCommitBlockListOptions) (BlockBlobCommitBlockListResponse, error) { dst, err := os.OpenFile(filepath.Join(f.path, finalFileName), os.O_CREATE+os.O_WRONLY, 0600) if err != nil { @@ -99,7 +99,7 @@ func (f *fakeBlockWriter) CommitBlockList(_ context.Context, base64BlockIDs []st return BlockBlobCommitBlockListResponse{}, nil } -//nolint +// nolint func (f *fakeBlockWriter) cleanup() { err := os.RemoveAll(f.path) if err != nil { @@ -107,12 +107,12 @@ func (f *fakeBlockWriter) cleanup() { } } -//nolint +// nolint func (f *fakeBlockWriter) final() string { return filepath.Join(f.path, finalFileName) } -//nolint +// nolint func createSrcFile(size int) (string, error) { generatedUuid, err := uuid.New() if err != nil { @@ -138,7 +138,7 @@ func createSrcFile(size int) (string, error) { return p, nil } -//nolint +// nolint func fileMD5(p string) string { f, err := os.Open(p) if err != nil { @@ -157,7 +157,7 @@ func fileMD5(p string) string { return fmt.Sprintf("%x", h.Sum(nil)) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestGetErr() { s.T().Parallel() @@ -199,7 +199,7 @@ func (s *azblobUnrecordedTestSuite) TestGetErr() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestCopyFromReader() { s.T().Parallel() diff --git a/sdk/storage/azblob/zt_client_provided_key_test.go b/sdk/storage/azblob/zt_client_provided_key_test.go index 7198f0f42716..2968a1caa5df 100644 --- a/sdk/storage/azblob/zt_client_provided_key_test.go +++ b/sdk/storage/azblob/zt_client_provided_key_test.go @@ -164,7 +164,7 @@ func (s *azblobTestSuite) TestPutBlockAndPutBlockListWithCPKByScope() { _require.EqualValues(*getResp.EncryptionScope, *testCPKByScope.EncryptionScope) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestPutBlockFromURLAndCommitWithCPK() { _require := require.New(s.T()) testName := s.T().Name() @@ -282,7 +282,7 @@ func (s *azblobUnrecordedTestSuite) TestPutBlockFromURLAndCommitWithCPK() { _require.EqualValues(*downloadResp.EncryptionKeySHA256, *testCPKByValue.EncryptionKeySHA256) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestPutBlockFromURLAndCommitWithCPKWithScope() { _require := require.New(s.T()) testName := s.T().Name() @@ -396,7 +396,7 @@ func (s *azblobUnrecordedTestSuite) TestPutBlockFromURLAndCommitWithCPKWithScope _require.EqualValues(*downloadResp.EncryptionScope, *testCPKByScope.EncryptionScope) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadBlobWithMD5WithCPK() { _require := require.New(s.T()) testName := s.T().Name() @@ -594,7 +594,7 @@ func (s *azblobTestSuite) TestAppendBlockWithCPKScope() { _require.EqualValues(*downloadResp.EncryptionScope, *testCPKByScope.EncryptionScope) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestAppendBlockFromURLWithCPK() { _require := require.New(s.T()) testName := s.T().Name() @@ -704,7 +704,7 @@ func (s *azblobUnrecordedTestSuite) TestAppendBlockFromURLWithCPK() { _require.EqualValues(destData, srcData) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestAppendBlockFromURLWithCPKScope() { _require := require.New(s.T()) testName := s.T().Name() @@ -801,7 +801,7 @@ func (s *azblobUnrecordedTestSuite) TestAppendBlockFromURLWithCPKScope() { _require.EqualValues(destData, srcData) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestPageBlockWithCPK() { _require := require.New(s.T()) testName := s.T().Name() @@ -861,7 +861,7 @@ func (s *azblobUnrecordedTestSuite) TestPageBlockWithCPK() { _require.EqualValues(*downloadResp.EncryptionKeySHA256, *testCPKByValue.EncryptionKeySHA256) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestPageBlockWithCPKScope() { _require := require.New(s.T()) testName := s.T().Name() @@ -911,7 +911,7 @@ func (s *azblobUnrecordedTestSuite) TestPageBlockWithCPKScope() { _require.EqualValues(*downloadResp.EncryptionScope, *testCPKByScope.EncryptionScope) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestPageBlockFromURLWithCPK() { _require := require.New(s.T()) testName := s.T().Name() @@ -996,7 +996,7 @@ func (s *azblobUnrecordedTestSuite) TestPageBlockFromURLWithCPK() { _require.EqualValues(destData, srcData) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestPageBlockFromURLWithCPKScope() { _require := require.New(s.T()) testName := s.T().Name() @@ -1072,7 +1072,7 @@ func (s *azblobUnrecordedTestSuite) TestPageBlockFromURLWithCPKScope() { _require.EqualValues(destData, srcData) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadPagesFromURLWithMD5WithCPK() { _require := require.New(s.T()) testName := s.T().Name() @@ -1424,7 +1424,7 @@ func (s *azblobTestSuite) TestBlobSnapshotWithCPKScope() { _require.Nil(err) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlobBlobPropertiesWithCPKKey() { _require := require.New(s.T()) testName := s.T().Name() @@ -1489,7 +1489,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlobBlobPropertiesWithCPKK _require.EqualValues(actualBlobData, blobData) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlobBlobPropertiesWithCPKScope() { _require := require.New(s.T()) testName := s.T().Name() diff --git a/sdk/storage/azblob/zt_highlevel_test.go b/sdk/storage/azblob/zt_highlevel_test.go index c9d8cd2f9a07..01fb9e64e055 100644 --- a/sdk/storage/azblob/zt_highlevel_test.go +++ b/sdk/storage/azblob/zt_highlevel_test.go @@ -18,7 +18,7 @@ import ( ) // create a test file -//nolint +// nolint func generateFile(fileName string, fileSize int) []byte { // generate random data _, bigBuff := generateData(fileSize) @@ -28,7 +28,7 @@ func generateFile(fileName string, fileSize int) []byte { return bigBuff } -//nolint +// nolint func performUploadStreamToBlockBlobTest(_require *require.Assertions, testName string, blobSize, bufferSize, maxBuffers int) { _context := getTestContext(testName) var recording *testframework.Recording @@ -70,7 +70,7 @@ func performUploadStreamToBlockBlobTest(_require *require.Assertions, testName s _require.EqualValues(actualBlobData, blobData) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlockBlobInChunks() { blobSize := 8 * 1024 bufferSize := 1024 @@ -80,7 +80,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlockBlobInChunks() { performUploadStreamToBlockBlobTest(_require, testName, blobSize, bufferSize, maxBuffers) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlockBlobSingleBuffer() { blobSize := 8 * 1024 bufferSize := 1024 @@ -90,7 +90,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlockBlobSingleBuffer() { performUploadStreamToBlockBlobTest(_require, testName, blobSize, bufferSize, maxBuffers) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlockBlobSingleIO() { blobSize := 1024 bufferSize := 8 * 1024 @@ -100,7 +100,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlockBlobSingleIO() { performUploadStreamToBlockBlobTest(_require, testName, blobSize, bufferSize, maxBuffers) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlockBlobSingleIOEdgeCase() { blobSize := 8 * 1024 bufferSize := 8 * 1024 @@ -110,7 +110,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlockBlobSingleIOEdgeCase( performUploadStreamToBlockBlobTest(_require, testName, blobSize, bufferSize, maxBuffers) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlockBlobEmpty() { blobSize := 0 bufferSize := 8 * 1024 @@ -120,7 +120,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlockBlobEmpty() { performUploadStreamToBlockBlobTest(_require, testName, blobSize, bufferSize, maxBuffers) } -//nolint +// nolint func performUploadAndDownloadFileTest(_require *require.Assertions, testName string, fileSize, blockSize, parallelism, downloadOffset, downloadCount int) { // Set up file to upload fileName := "BigFile.bin" @@ -217,7 +217,7 @@ func performUploadAndDownloadFileTest(_require *require.Assertions, testName str } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileInChunks() { fileSize := 8 * 1024 blockSize := 1024 @@ -227,7 +227,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileInChunks() { performUploadAndDownloadFileTest(_require, testName, fileSize, blockSize, parallelism, 0, 0) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileSingleIO() { fileSize := 1024 blockSize := 2048 @@ -237,7 +237,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileSingleIO() { performUploadAndDownloadFileTest(_require, testName, fileSize, blockSize, parallelism, 0, 0) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileSingleRoutine() { fileSize := 8 * 1024 blockSize := 1024 @@ -247,7 +247,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileSingleRoutine() { performUploadAndDownloadFileTest(_require, testName, fileSize, blockSize, parallelism, 0, 0) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileEmpty() { fileSize := 0 blockSize := 1024 @@ -257,7 +257,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileEmpty() { performUploadAndDownloadFileTest(_require, testName, fileSize, blockSize, parallelism, 0, 0) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileNonZeroOffset() { fileSize := 8 * 1024 blockSize := 1024 @@ -269,7 +269,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileNonZeroOffset() { performUploadAndDownloadFileTest(_require, testName, fileSize, blockSize, parallelism, downloadOffset, downloadCount) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileNonZeroCount() { fileSize := 8 * 1024 blockSize := 1024 @@ -281,7 +281,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileNonZeroCount() { performUploadAndDownloadFileTest(_require, testName, fileSize, blockSize, parallelism, downloadOffset, downloadCount) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileNonZeroOffsetAndCount() { fileSize := 8 * 1024 blockSize := 1024 @@ -293,7 +293,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadFileNonZeroOffsetAndCou performUploadAndDownloadFileTest(_require, testName, fileSize, blockSize, parallelism, downloadOffset, downloadCount) } -//nolint +// nolint func performUploadAndDownloadBufferTest(_require *require.Assertions, testName string, blobSize, blockSize, parallelism, downloadOffset, downloadCount int) { // Set up buffer to upload _, bytesToUpload := generateData(blobSize) @@ -359,7 +359,7 @@ func performUploadAndDownloadBufferTest(_require *require.Assertions, testName s } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadBufferInChunks() { blobSize := 8 * 1024 blockSize := 1024 @@ -369,7 +369,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadBufferInChunks() { performUploadAndDownloadBufferTest(_require, testName, blobSize, blockSize, parallelism, 0, 0) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadBufferSingleIO() { blobSize := 1024 blockSize := 8 * 1024 @@ -379,7 +379,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadBufferSingleIO() { performUploadAndDownloadBufferTest(_require, testName, blobSize, blockSize, parallelism, 0, 0) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadBufferSingleRoutine() { blobSize := 8 * 1024 blockSize := 1024 @@ -389,7 +389,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadBufferSingleRoutine() { performUploadAndDownloadBufferTest(_require, testName, blobSize, blockSize, parallelism, 0, 0) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadBufferEmpty() { blobSize := 0 blockSize := 1024 @@ -399,7 +399,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadAndDownloadBufferEmpty() { performUploadAndDownloadBufferTest(_require, testName, blobSize, blockSize, parallelism, 0, 0) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestDownloadBufferWithNonZeroOffset() { blobSize := 8 * 1024 blockSize := 1024 @@ -411,7 +411,7 @@ func (s *azblobUnrecordedTestSuite) TestDownloadBufferWithNonZeroOffset() { performUploadAndDownloadBufferTest(_require, testName, blobSize, blockSize, parallelism, downloadOffset, downloadCount) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestDownloadBufferWithNonZeroCount() { blobSize := 8 * 1024 blockSize := 1024 @@ -423,7 +423,7 @@ func (s *azblobUnrecordedTestSuite) TestDownloadBufferWithNonZeroCount() { performUploadAndDownloadBufferTest(_require, testName, blobSize, blockSize, parallelism, downloadOffset, downloadCount) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestDownloadBufferWithNonZeroOffsetAndCount() { blobSize := 8 * 1024 blockSize := 1024 @@ -435,7 +435,7 @@ func (s *azblobUnrecordedTestSuite) TestDownloadBufferWithNonZeroOffsetAndCount( performUploadAndDownloadBufferTest(_require, testName, blobSize, blockSize, parallelism, downloadOffset, downloadCount) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBasicDoBatchTransfer() { _require := require.New(s.T()) // test the basic multi-routine processing @@ -485,14 +485,14 @@ func (s *azblobUnrecordedTestSuite) TestBasicDoBatchTransfer() { } // mock a memory mapped file (low-quality mock, meant to simulate the scenario only) -//nolint +// nolint type mockMMF struct { isClosed bool failHandle *require.Assertions } // accept input -//nolint +// nolint func (m *mockMMF) write(_ string) { if m.isClosed { // simulate panic @@ -500,7 +500,7 @@ func (m *mockMMF) write(_ string) { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestDoBatchTransferWithError() { _require := require.New(s.T()) ctx := context.Background() @@ -542,7 +542,7 @@ func (s *azblobUnrecordedTestSuite) TestDoBatchTransferWithError() { time.Sleep(time.Second * 5) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadStreamToBlobProperties() { _require := require.New(s.T()) testName := s.T().Name() diff --git a/sdk/storage/azblob/zt_lease_client_test.go b/sdk/storage/azblob/zt_lease_client_test.go index 3868fdf18ae1..b3d217077e51 100644 --- a/sdk/storage/azblob/zt_lease_client_test.go +++ b/sdk/storage/azblob/zt_lease_client_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" ) -//var headersToIgnoreForLease = []string {"X-Ms-Proposed-Lease-Id", "X-Ms-Lease-Id"} +// var headersToIgnoreForLease = []string {"X-Ms-Proposed-Lease-Id", "X-Ms-Lease-Id"} var proposedLeaseIDs = []*string{to.Ptr("c820a799-76d7-4ee2-6e15-546f19325c2c"), to.Ptr("326cc5e1-746e-4af8-4811-a50e6629a8ca")} func (s *azblobTestSuite) TestContainerAcquireLease() { diff --git a/sdk/storage/azblob/zt_ors_test.go b/sdk/storage/azblob/zt_ors_test.go index 12c6fcdfeb45..9ead4c1bc2c3 100644 --- a/sdk/storage/azblob/zt_ors_test.go +++ b/sdk/storage/azblob/zt_ors_test.go @@ -8,7 +8,7 @@ package azblob import "github.com/stretchr/testify/require" -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestDeserializeORSPolicies() { _require := require.New(s.T()) diff --git a/sdk/storage/azblob/zt_page_blob_client_test.go b/sdk/storage/azblob/zt_page_blob_client_test.go index 3dad1cb82145..4bd378ab4af7 100644 --- a/sdk/storage/azblob/zt_page_blob_client_test.go +++ b/sdk/storage/azblob/zt_page_blob_client_test.go @@ -75,7 +75,7 @@ func (s *azblobTestSuite) TestPutGetPages() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadPagesFromURL() { _require := require.New(s.T()) testName := s.T().Name() @@ -147,7 +147,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadPagesFromURL() { _require.EqualValues(destData, sourceData) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestUploadPagesFromURLWithMD5() { _require := require.New(s.T()) testName := s.T().Name() @@ -229,7 +229,7 @@ func (s *azblobUnrecordedTestSuite) TestUploadPagesFromURLWithMD5() { validateStorageError(_require, err, StorageErrorCodeMD5Mismatch) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestClearDiffPages() { _require := require.New(s.T()) testName := s.T().Name() @@ -284,7 +284,7 @@ func (s *azblobUnrecordedTestSuite) TestClearDiffPages() { } } -//nolint +// nolint func waitForIncrementalCopy(_require *require.Assertions, copyBlobClient *PageBlobClient, blobCopyResponse *PageBlobCopyIncrementalResponse) *string { status := *blobCopyResponse.CopyStatus var getPropertiesAndMetadataResult BlobGetPropertiesResponse @@ -301,7 +301,7 @@ func waitForIncrementalCopy(_require *require.Assertions, copyBlobClient *PageBl return getPropertiesAndMetadataResult.DestinationSnapshot } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestIncrementalCopy() { _require := require.New(s.T()) testName := s.T().Name() @@ -429,7 +429,7 @@ func (s *azblobTestSuite) TestPageSequenceNumbers() { _require.Equal(resp.RawResponse.StatusCode, 200) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestPutPagesWithMD5() { _require := require.New(s.T()) testName := s.T().Name() @@ -949,7 +949,7 @@ func (s *azblobTestSuite) TestBlobCreatePageIfNoneMatchFalse() { validateStorageError(_require, err, StorageErrorCodeConditionNotMet) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobPutPagesInvalidRange() { _require := require.New(s.T()) testName := s.T().Name() @@ -2409,7 +2409,7 @@ func (s *azblobTestSuite) TestBlobGetPageRangesIfNoneMatchFalse() { //_require.(serr.RawResponse.StatusCode, chk.Equals, 304) // Service Code not returned in the body for a HEAD } -//nolint +// nolint func setupDiffPageRangesTest(_require *require.Assertions, testName string) (containerClient *ContainerClient, pbClient *PageBlobClient, snapshot string) { _context := getTestContext(testName) var recording *testframework.Recording @@ -2449,7 +2449,7 @@ func setupDiffPageRangesTest(_require *require.Assertions, testName string) (con return } -//nolint +// nolint func validateDiffPageRanges(_require *require.Assertions, resp PageList, err error) { _require.Nil(err) pageListResp := resp.PageRange @@ -2461,7 +2461,7 @@ func validateDiffPageRanges(_require *require.Assertions, resp PageList, err err _require.EqualValues(rawEnd, end) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangesNonExistentSnapshot() { _require := require.New(s.T()) testName := s.T().Name() @@ -2481,7 +2481,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangesNonExistentSnapshot() } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeInvalidRange() { _require := require.New(s.T()) testName := s.T().Name() @@ -2494,7 +2494,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeInvalidRange() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfModifiedSinceTrue() { _require := require.New(s.T()) testName := s.T().Name() @@ -2516,7 +2516,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfModifiedSinceTrue() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfModifiedSinceFalse() { _require := require.New(s.T()) testName := s.T().Name() @@ -2543,7 +2543,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfModifiedSinceFalse() } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfUnmodifiedSinceTrue() { _require := require.New(s.T()) testName := s.T().Name() @@ -2567,7 +2567,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfUnmodifiedSinceTrue() } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfUnmodifiedSinceFalse() { _require := require.New(s.T()) testName := s.T().Name() @@ -2592,7 +2592,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfUnmodifiedSinceFalse( } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfMatchTrue() { _require := require.New(s.T()) testName := s.T().Name() @@ -2618,7 +2618,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfMatchTrue() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfMatchFalse() { _require := require.New(s.T()) testName := s.T().Name() @@ -2640,7 +2640,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfMatchFalse() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfNoneMatchTrue() { _require := require.New(s.T()) testName := s.T().Name() @@ -2663,7 +2663,7 @@ func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfNoneMatchTrue() { } } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestBlobDiffPageRangeIfNoneMatchFalse() { _require := require.New(s.T()) testName := s.T().Name() diff --git a/sdk/storage/azblob/zt_retry_reader_test.go b/sdk/storage/azblob/zt_retry_reader_test.go index e955e92bc382..85c88e8b98b3 100644 --- a/sdk/storage/azblob/zt_retry_reader_test.go +++ b/sdk/storage/azblob/zt_retry_reader_test.go @@ -20,7 +20,7 @@ import ( // Testings for RetryReader // This reader return one byte through each Read call -//nolint +// nolint type perByteReader struct { RandomBytes []byte // Random generated bytes @@ -36,7 +36,7 @@ type perByteReader struct { closeChannel chan struct{} } -//nolint +// nolint func newPerByteReader(byteCount int) *perByteReader { perByteReader := perByteReader{ byteCount: byteCount, @@ -49,7 +49,7 @@ func newPerByteReader(byteCount int) *perByteReader { return &perByteReader } -//nolint +// nolint func newSingleUsePerByteReader(contents []byte) *perByteReader { perByteReader := perByteReader{ byteCount: len(contents), @@ -61,7 +61,7 @@ func newSingleUsePerByteReader(contents []byte) *perByteReader { return &perByteReader } -//nolint +// nolint func (r *perByteReader) Read(b []byte) (n int, err error) { if r.doInjectError && r.doInjectErrorByteIndex == r.currentByteIndex && r.doInjectTimes > 0 { r.doInjectTimes-- @@ -85,7 +85,7 @@ func (r *perByteReader) Read(b []byte) (n int, err error) { return 0, io.EOF } -//nolint +// nolint func (r *perByteReader) Close() error { if r.closeChannel != nil { r.closeChannel <- struct{}{} @@ -95,7 +95,7 @@ func (r *perByteReader) Close() error { // Test normal retry succeed, note initial response not provided. // Tests both with and without notification of failures -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestRetryReaderReadWithRetry() { _require := require.New(s.T()) // Test twice, the second time using the optional "logging"/notification callback for failed tries @@ -167,7 +167,7 @@ func (s *azblobUnrecordedTestSuite) TestRetryReaderReadWithRetry() { // Test normal retry succeed, note initial response not provided. // Tests both with and without notification of failures -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestRetryReaderWithRetryIoUnexpectedEOF() { _require := require.New(s.T()) // Test twice, the second time using the optional "logging"/notification callback for failed tries @@ -238,7 +238,7 @@ func (s *azblobUnrecordedTestSuite) TestRetryReaderWithRetryIoUnexpectedEOF() { } // Test normal retry fail as retry Count not enough. -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestRetryReaderReadNegativeNormalFail() { _require := require.New(s.T()) // Extra setup for testing notification of failures (i.e. of unsuccessful tries) @@ -295,7 +295,7 @@ func (s *azblobUnrecordedTestSuite) TestRetryReaderReadNegativeNormalFail() { } // Test boundary case when Count equals to 0 and fail. -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestRetryReaderReadCount0() { _require := require.New(s.T()) byteCount := 1 @@ -330,7 +330,7 @@ func (s *azblobUnrecordedTestSuite) TestRetryReaderReadCount0() { _require.Equal(err, io.EOF) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestRetryReaderReadNegativeNonRetriableError() { _require := require.New(s.T()) byteCount := 1 @@ -363,7 +363,7 @@ func (s *azblobUnrecordedTestSuite) TestRetryReaderReadNegativeNonRetriableError // purposes of unit testing, here we are testing the cancellation mechanism that is exposed to // consumers of the API, to allow programmatic forcing of retries (e.g. if the consumer deems // the read to be taking too long, they may force a retry in the hope of better performance next time). -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestRetryReaderReadWithForcedRetry() { _require := require.New(s.T()) for _, enableRetryOnEarlyClose := range []bool{false, true} { diff --git a/sdk/storage/azblob/zt_section_writer_test.go b/sdk/storage/azblob/zt_section_writer_test.go index 2b9c36862ee6..85367ada0a21 100644 --- a/sdk/storage/azblob/zt_section_writer_test.go +++ b/sdk/storage/azblob/zt_section_writer_test.go @@ -12,7 +12,7 @@ import ( "io" ) -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSectionWriter() { _require := require.New(s.T()) b := [10]byte{} @@ -71,7 +71,7 @@ func (s *azblobUnrecordedTestSuite) TestSectionWriter() { _require.Equal(b, [10]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSectionWriterCopySrcDestEmpty() { _require := require.New(s.T()) input := make([]byte, 0) @@ -86,7 +86,7 @@ func (s *azblobUnrecordedTestSuite) TestSectionWriterCopySrcDestEmpty() { _require.Equal(count, int64(0)) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestSectionWriterCopyDestEmpty() { _require := require.New(s.T()) input := make([]byte, 10) diff --git a/sdk/storage/azblob/zt_service_client_test.go b/sdk/storage/azblob/zt_service_client_test.go index 99adb774ab1c..a559337c1a4f 100644 --- a/sdk/storage/azblob/zt_service_client_test.go +++ b/sdk/storage/azblob/zt_service_client_test.go @@ -29,7 +29,7 @@ func (s *azblobTestSuite) TestGetAccountInfo() { _require.NotEqualValues(sAccInfo, ServiceGetAccountInfoResponse{}) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestServiceClientFromConnectionString() { _require := require.New(s.T()) testName := s.T().Name() @@ -47,7 +47,7 @@ func (s *azblobUnrecordedTestSuite) TestServiceClientFromConnectionString() { defer deleteContainer(_require, containerClient) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestListContainersBasic() { _require := require.New(s.T()) testName := s.T().Name() @@ -106,7 +106,7 @@ func (s *azblobUnrecordedTestSuite) TestListContainersBasic() { _require.GreaterOrEqual(count, 0) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestListContainersBasicUsingConnectionString() { _require := require.New(s.T()) testName := s.T().Name() @@ -421,7 +421,7 @@ func (s *azblobTestSuite) TestAccountDeleteRetentionPolicyDaysTooSmall() { _require.NotNil(err) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) TestAccountDeleteRetentionPolicyDaysTooLarge() { _require := require.New(s.T()) var svcClient *ServiceClient diff --git a/sdk/storage/azblob/zt_test.go b/sdk/storage/azblob/zt_test.go index cddadcee9521..2e4fa8249805 100644 --- a/sdk/storage/azblob/zt_test.go +++ b/sdk/storage/azblob/zt_test.go @@ -37,7 +37,7 @@ type azblobTestSuite struct { mode testframework.RecordMode } -//nolint +// nolint type azblobUnrecordedTestSuite struct { suite.Suite } @@ -96,24 +96,24 @@ func recordedTestTeardown(key string) { } } -//nolint +// nolint func (s *azblobTestSuite) BeforeTest(suite string, test string) { // set up the test environment recordedTestSetup(s.T(), s.mode) } -//nolint +// nolint func (s *azblobTestSuite) AfterTest(suite string, test string) { // teardown the test context recordedTestTeardown(s.T().Name()) } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) BeforeTest(suite string, test string) { } -//nolint +// nolint func (s *azblobUnrecordedTestSuite) AfterTest(suite string, test string) { } @@ -121,7 +121,7 @@ func (s *azblobUnrecordedTestSuite) AfterTest(suite string, test string) { // Vars for const DefaultEndpointSuffix = "core.windows.net/" -//const DefaultBlobEndpointSuffix = "blob.core.windows.net/" +// const DefaultBlobEndpointSuffix = "blob.core.windows.net/" const AccountNameEnvVar = "AZURE_STORAGE_ACCOUNT_NAME" const AccountKeyEnvVar = "AZURE_STORAGE_ACCOUNT_KEY" const DefaultEndpointSuffixEnvVar = "AZURE_STORAGE_ENDPOINT_SUFFIX" @@ -154,14 +154,14 @@ var basicHeaders = BlobHTTPHeaders{ var basicMetadata = map[string]string{"Foo": "bar"} -//nolint +// nolint var basicBlobTagsMap = map[string]string{ "azure": "blob", "blob": "sdk", "sdk": "go", } -//nolint +// nolint var specialCharBlobTagsMap = map[string]string{ "+-./:=_ ": "firsttag", "tag2": "+-./:=_", @@ -176,7 +176,7 @@ var specialCharBlobTagsMap = map[string]string{ // This should make it easy to associate the entities with their test, uniquely identify // them, and determine the order in which they were created. // Note that this imposes a restriction on the length of test names -//nolint +// nolint func generateName(prefix string) string { // These next lines up through the for loop are obtaining and walking up the stack // trace to extract the test name, which is stored in name @@ -230,7 +230,7 @@ func getReaderToGeneratedBytes(n int) io.ReadSeekCloser { return internal.NopCloser(r) } -//nolint +// nolint func getRandomDataAndReader(n int) (*bytes.Reader, []byte) { data := make([]byte, n) rand.Read(data) @@ -389,7 +389,7 @@ func getGenericCredential(recording *testframework.Recording, accountType testAc return NewSharedKeyCredential(accountName, accountKey) } -//nolint +// nolint func getConnectionString(recording *testframework.Recording, accountType testAccountType) string { accountName, accountKey := getAccountInfo(recording, accountType) connectionString := fmt.Sprintf("DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s;EndpointSuffix=core.windows.net/", @@ -397,7 +397,7 @@ func getConnectionString(recording *testframework.Recording, accountType testAcc return connectionString } -//nolint +// nolint func getServiceClientFromConnectionString(recording *testframework.Recording, accountType testAccountType, options *ClientOptions) (*ServiceClient, error) { if recording != nil { if options == nil { @@ -448,7 +448,7 @@ func getServiceClient(recording *testframework.Recording, accountType testAccoun return serviceClient, err } -//nolint +// nolint func getRelativeTimeGMT(amount time.Duration) time.Time { currentTime := time.Now().In(time.FixedZone("GMT", 0)) currentTime = currentTime.Add(amount * time.Second) diff --git a/sdk/storage/azblob/zz_generated_models.go b/sdk/storage/azblob/zz_generated_models.go index d40d63b1b0d4..ce75398d0d10 100644 --- a/sdk/storage/azblob/zz_generated_models.go +++ b/sdk/storage/azblob/zz_generated_models.go @@ -883,7 +883,7 @@ func (q QueryRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error { return e.EncodeElement(aux, start) } -//QuerySerialization struct +// QuerySerialization struct type QuerySerialization struct { // REQUIRED Format *QueryFormat `xml:"Format"`