Repository: Azure/azure-sdk-for-go
Pull request #19373 (2022-10-17 17:50:41)

Chore: remove nolint comments
Added test for LRO failure case.

Fixes https://github.com/Azure/azure-sdk-for-go/issues/15173


Patch:
diff --git a/sdk/azcore/CHANGELOG.md b/sdk/azcore/CHANGELOG.md
index 7c994f3533..44129efc5e 100644
--- a/sdk/azcore/CHANGELOG.md
+++ b/sdk/azcore/CHANGELOG.md
@@ -1,8 +1,10 @@
 # Release History
 
-## 1.1.5 (Unreleased)
+## 1.2.0 (Unreleased)
 
 ### Features Added
+* Added `ClientOptions.APIVersion` field, which overrides the default version a client
+  requests of the service, if the client supports this (all ARM clients do).
 
 ### Breaking Changes
 
diff --git a/sdk/azcore/arm/runtime/pipeline.go b/sdk/azcore/arm/runtime/pipeline.go
index f72aa43012..3476735014 100644
--- a/sdk/azcore/arm/runtime/pipeline.go
+++ b/sdk/azcore/arm/runtime/pipeline.go
@@ -43,6 +43,9 @@ func NewPipeline(module, version string, cred azcore.TokenCredential, plOpts azr
 		copy(perCall, plOpts.PerCall)
 		plOpts.PerCall = append(perCall, regPolicy)
 	}
+	if plOpts.APIVersionName == "" {
+		plOpts.APIVersionName = "api-version"
+	}
 	return azruntime.NewPipeline(module, version, plOpts, &options.ClientOptions), nil
 }
 
diff --git a/sdk/azcore/internal/shared/constants.go b/sdk/azcore/internal/shared/constants.go
index 22d19afe50..75d241c5b4 100644
--- a/sdk/azcore/internal/shared/constants.go
+++ b/sdk/azcore/internal/shared/constants.go
@@ -30,5 +30,5 @@ const (
 	Module = "azcore"
 
 	// Version is the semantic version (see http://semver.org) of this module.
-	Version = "v1.1.5"
+	Version = "v1.2.0"
 )
diff --git a/sdk/azcore/policy/policy.go b/sdk/azcore/policy/policy.go
index 1ba320aef3..feb4e4d83d 100644
--- a/sdk/azcore/policy/policy.go
+++ b/sdk/azcore/policy/policy.go
@@ -27,6 +27,9 @@ type Request = exported.Request
 // ClientOptions contains optional settings for a client's pipeline.
 // All zero-value fields will be initialized with default values.
 type ClientOptions struct {
+	// APIVersion overrides the default version requested of the service. Set with caution as this package version has not been tested with arbitrary service versions.
+	APIVersion string
+
 	// Cloud specifies a cloud for the client. The default is Azure Public Cloud.
 	Cloud cloud.Configuration
 
diff --git a/sdk/azcore/runtime/pipeline.go b/sdk/azcore/runtime/pipeline.go
index ad75ae2ab2..f61bf5f732 100644
--- a/sdk/azcore/runtime/pipeline.go
+++ b/sdk/azcore/runtime/pipeline.go
@@ -16,6 +16,8 @@ import (
 // PipelineOptions contains Pipeline options for SDK developers
 type PipelineOptions struct {
 	AllowedHeaders, AllowedQueryParameters []string
+	APIVersionLocation                     APIVersionLocation
+	APIVersionName                         string
 	PerCall, PerRetry                      []policy.Policy
 }
 
@@ -46,6 +48,9 @@ func NewPipeline(module, version string, plOpts PipelineOptions, options *policy
 	// we put the includeResponsePolicy at the very beginning so that the raw response
 	// is populated with the final response (some policies might mutate the response)
 	policies := []policy.Policy{policyFunc(includeResponsePolicy)}
+	if cp.APIVersion != "" {
+		policies = append(policies, NewAPIVersionPolicy(plOpts.APIVersionLocation, plOpts.APIVersionName, cp.APIVersion))
+	}
 	if !cp.Telemetry.Disabled {
 		policies = append(policies, NewTelemetryPolicy(module, version, &cp.Telemetry))
 	}
diff --git a/sdk/azcore/runtime/policy_api_version.go b/sdk/azcore/runtime/policy_api_version.go
new file mode 100644
index 0000000000..8c34a569e8
--- /dev/null
+++ b/sdk/azcore/runtime/policy_api_version.go
@@ -0,0 +1,65 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package runtime
+
+import (
+	"errors"
+	"fmt"
+	"net/http"
+
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+)
+
+// APIVersionLocation indicates which part of a request identifies the service version
+type APIVersionLocation int
+
+const (
+	// APIVersionLocationQueryParam indicates a query parameter
+	APIVersionLocationQueryParam = 0
+	// APIVersionLocationHeader indicates a header
+	APIVersionLocationHeader = 1
+)
+
+// NewAPIVersionPolicy constructs an APIVersionPolicy. name is the name of the query parameter or header and
+// version is its value. If version is "", Do will be a no-op. If version isn't empty and name is empty,
+// Do will return an error.
+func NewAPIVersionPolicy(location APIVersionLocation, name, version string) *APIVersionPolicy {
+	return &APIVersionPolicy{location: location, name: name, version: version}
+}
+
+// APIVersionPolicy enables users to set the API version of every request a client sends.
+type APIVersionPolicy struct {
+	// location indicates whether "name" refers to a query parameter or header.
+	location APIVersionLocation
+
+	// name of the query param or header whose value should be overridden; provided by the client.
+	name string
+
+	// version is the value (provided by the user) that replaces the default version value.
+	version string
+}
+
+// Do sets the request's API version, if the policy is configured to do so, replacing any prior value.
+func (a *APIVersionPolicy) Do(req *policy.Request) (*http.Response, error) {
+	if a.version != "" {
+		if a.name == "" {
+			// user set ClientOptions.APIVersion but the client ctor didn't set PipelineOptions.APIVersionLocation
+			return nil, errors.New("this client doesn't support overriding its API version")
+		}
+		switch a.location {
+		case APIVersionLocationHeader:
+			req.Raw().Header.Set(a.name, a.version)
+		case APIVersionLocationQueryParam:
+			q := req.Raw().URL.Query()
+			q.Set(a.name, a.version)
+			req.Raw().URL.RawQuery = q.Encode()
+		default:
+			return nil, fmt.Errorf("unknown APIVersionLocation %d", a.location)
+		}
+	}
+	return req.Next()
+}
diff --git a/sdk/data/azcosmos/version.go b/sdk/data/azcosmos/version.go
index 5d65b0935d..c606058ac6 100644
--- a/sdk/data/azcosmos/version.go
+++ b/sdk/data/azcosmos/version.go
@@ -4,4 +4,4 @@
 package azcosmos
 
 // serviceLibVersion is the semantic version (see http://semver.org) of this module.
-const serviceLibVersion = "v0.3.3" //nolint
+const serviceLibVersion = "v0.3.3"
diff --git a/sdk/storage/azblob/CHANGELOG.md b/sdk/storage/azblob/CHANGELOG.md
index 8d057135e2..32427330af 100644
--- a/sdk/storage/azblob/CHANGELOG.md
+++ b/sdk/storage/azblob/CHANGELOG.md
@@ -10,6 +10,8 @@
 
 ### Other Changes
 
+* Avoid allocations when storing/fetching a slice via sync.Pool.
+
 ## 0.5.1 (2022-10-11)
 
 ### Bugs Fixed
diff --git a/sdk/storage/azblob/blockblob/constants.go b/sdk/storage/azblob/blockblob/constants.go
index 46de1ede7e..6a7796f440 100644
--- a/sdk/storage/azblob/blockblob/constants.go
+++ b/sdk/storage/azblob/blockblob/constants.go
@@ -8,7 +8,6 @@ package blockblob
 
 import "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated"
 
-// nolint
 const (
 	// CountToEnd specifies the end of the file
 	CountToEnd = 0
diff --git a/sdk/storage/azblob/internal/shared/transfer_manager.go b/sdk/storage/azblob/internal/shared/transfer_manager.go
index f3c9d4be7e..df994f7566 100644
--- a/sdk/storage/azblob/internal/shared/transfer_manager.go
+++ b/sdk/storage/azblob/internal/shared/transfer_manager.go
@@ -22,7 +22,7 @@ type TransferManager interface {
 
 	// Put may or may not put the buffer into underlying storage, depending on settings.
 	// The buffer must not be touched after this has been called.
-	Put(b []byte) // nolint
+	Put(b []byte)
 
 	// Run will use a goroutine pool entry to run a function. This blocks until a pool
 	// goroutine becomes available.
@@ -78,7 +78,7 @@ func (s staticBuffer) Get() []byte {
 }
 
 // Put implements TransferManager.Put().
-func (s staticBuffer) Put(b []byte) { // nolint
+func (s staticBuffer) Put(b []byte) {
 	select {
 	case s.buffers <- b:
 	default: // This shouldn't happen, but just in case they call Put() with there own buffer.
@@ -128,7 +128,8 @@ func NewSyncPool(size, concurrency int) (TransferManager, error) {
 		threadpool: threadpool,
 		pool: sync.Pool{
 			New: func() interface{} {
-				return make([]byte, size)
+				buf := make([]byte, size)
+				return &buf
 			},
 		},
 	}, nil
@@ -136,13 +137,12 @@ func NewSyncPool(size, concurrency int) (TransferManager, error) {
 
 // Get implements TransferManager.Get().
 func (s *syncPool) Get() []byte {
-	return s.pool.Get().([]byte)
+	return *s.pool.Get().(*[]byte)
 }
 
 // Put implements TransferManager.Put().
-// nolint
 func (s *syncPool) Put(b []byte) {
-	s.pool.Put(b)
+	s.pool.Put(&b)
 }
 
 // Run implements TransferManager.Run().


Test patch:
diff --git a/sdk/azcore/arm/runtime/pipeline_test.go b/sdk/azcore/arm/runtime/pipeline_test.go
index c3758f5ce1..752bcbcb55 100644
--- a/sdk/azcore/arm/runtime/pipeline_test.go
+++ b/sdk/azcore/arm/runtime/pipeline_test.go
@@ -20,8 +20,27 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
 	azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
 	"github.com/Azure/azure-sdk-for-go/sdk/internal/mock"
+	"github.com/stretchr/testify/require"
 )
 
+func TestNewPipelineWithAPIVersion(t *testing.T) {
+	version := "42"
+	srv, close := mock.NewServer()
+	defer close()
+	srv.SetResponse()
+	pl, err := NewPipeline("...", "...", mockCredential{}, azruntime.PipelineOptions{}, &arm.ClientOptions{
+		ClientOptions: policy.ClientOptions{
+			APIVersion: version,
+		},
+	})
+	require.NoError(t, err)
+	req, err := azruntime.NewRequest(context.Background(), http.MethodGet, srv.URL())
+	require.NoError(t, err)
+	res, err := pl.Do(req)
+	require.NoError(t, err)
+	require.Equal(t, version, res.Request.URL.Query().Get(string("api-version")))
+}
+
 func TestNewPipelineWithOptions(t *testing.T) {
 	srv, close := mock.NewServer()
 	defer close()
diff --git a/sdk/azcore/example_test.go b/sdk/azcore/example_test.go
index 79c4f80d90..c233ffc654 100644
--- a/sdk/azcore/example_test.go
+++ b/sdk/azcore/example_test.go
@@ -21,13 +21,13 @@ import (
 )
 
 // false positive by linter
-func ExampleSetEvents() { //nolint:govet
+func ExampleSetEvents() {
 	// only log HTTP requests and responses
 	log.SetEvents(log.EventRequest, log.EventResponse)
 }
 
 // false positive by linter
-func ExampleSetListener() { //nolint:govet
+func ExampleSetListener() {
 	// a simple logger that writes to stdout
 	log.SetListener(func(cls log.Event, msg string) {
 		fmt.Printf("%s: %s\n", cls, msg)
diff --git a/sdk/azcore/runtime/policy_api_version_test.go b/sdk/azcore/runtime/policy_api_version_test.go
new file mode 100644
index 0000000000..b4f79959ca
--- /dev/null
+++ b/sdk/azcore/runtime/policy_api_version_test.go
@@ -0,0 +1,106 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package runtime
+
+import (
+	"context"
+	"net/http"
+	"testing"
+
+	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+	"github.com/Azure/azure-sdk-for-go/sdk/internal/mock"
+	"github.com/stretchr/testify/require"
+)
+
+func TestAPIVersionPolicy(t *testing.T) {
+	name, version := "api-version", "42"
+	srv, close := mock.NewServer()
+	defer close()
+	srv.SetResponse()
+
+	for _, header := range []bool{true, false} {
+		s := "query param"
+		if header {
+			s = "header"
+		}
+		t.Run(s, func(t *testing.T) {
+			var location APIVersionLocation = APIVersionLocationQueryParam
+			if header {
+				location = APIVersionLocationHeader
+			}
+			p := NewAPIVersionPolicy(location, name, version)
+			pl := newTestPipeline(&policy.ClientOptions{Transport: srv, PerCallPolicies: []policy.Policy{p}})
+
+			// when the value isn't set, the policy should set it
+			req, err := NewRequest(context.Background(), http.MethodGet, srv.URL())
+			require.NoError(t, err)
+			res, err := pl.Do(req)
+			require.NoError(t, err)
+			if header {
+				require.Equal(t, version, res.Request.Header.Get(name))
+			} else {
+				require.Equal(t, version, res.Request.URL.Query().Get(name))
+			}
+
+			// the policy should override an existing value
+			req, err = NewRequest(context.Background(), http.MethodGet, srv.URL())
+			require.NoError(t, err)
+			if header {
+				req.Raw().Header.Set(s, "not-"+version)
+			} else {
+				q := req.Raw().URL.Query()
+				q.Set(s, "not-"+version)
+				req.Raw().URL.RawQuery = q.Encode()
+			}
+			res, err = pl.Do(req)
+			require.NoError(t, err)
+			if header {
+				require.Equal(t, version, res.Request.Header.Get(name))
+			} else {
+				require.Equal(t, version, res.Request.URL.Query().Get(name))
+			}
+		})
+	}
+
+	for _, test := range []struct {
+		err           bool
+		location      APIVersionLocation
+		name, version string
+	}{
+		// the policy should modify the request only when given both a version and parameter name
+		{},
+		{location: APIVersionLocationHeader, version: ""},
+		{location: APIVersionLocationQueryParam, version: ""},
+
+		// The policy must know which header/query param to set. This should come from the service client
+		// ctor via NewPipeline(). The policy should return an error when the user specifies a version
+		// the policy can't set because the service client didn't identify the header/query param.
+		{version: version, err: true},
+		{location: 2, version: version, err: true},
+	} {
+		t.Run("no-op", func(t *testing.T) {
+			p := NewAPIVersionPolicy(test.location, test.name, test.version)
+			pl := newTestPipeline(&policy.ClientOptions{Transport: srv, PerCallPolicies: []policy.Policy{p}})
+			req, err := NewRequest(context.Background(), http.MethodGet, srv.URL())
+			require.NoError(t, err)
+			res, err := pl.Do(req)
+			if test.err {
+				require.Error(t, err)
+				return
+			}
+			require.NoError(t, err)
+			for _, p := range res.Request.URL.Query() {
+				require.NotEqual(t, name, p)
+				require.NotContains(t, p, version)
+			}
+			for _, h := range res.Request.Header {
+				require.NotEqual(t, name, h)
+				require.NotContains(t, h, version)
+			}
+		})
+	}
+}
diff --git a/sdk/azcore/runtime/poller_test.go b/sdk/azcore/runtime/poller_test.go
index 88773ef6a7..484892f5b1 100644
--- a/sdk/azcore/runtime/poller_test.go
+++ b/sdk/azcore/runtime/poller_test.go
@@ -750,7 +750,7 @@ const (
 	provStateStarted   = `{ "properties": { "provisioningState": "Started" } }`
 	provStateUpdating  = `{ "properties": { "provisioningState": "Updating" } }`
 	provStateSucceeded = `{ "properties": { "provisioningState": "Succeeded" }, "field": "value" }`
-	provStateFailed    = `{ "properties": { "provisioningState": "Failed" } }` //nolint
+	provStateFailed    = `{ "properties": { "provisioningState": "Failed" } }`
 	statusInProgress   = `{ "status": "InProgress" }`
 	statusSucceeded    = `{ "status": "Succeeded" }`
 	statusCanceled     = `{ "status": "Canceled", "error": { "code": "OperationCanceled", "message": "somebody canceled it" } }`
@@ -936,6 +936,30 @@ func TestNewPollerCanceled(t *testing.T) {
 	}
 }
 
+func TestNewPollerFailed(t *testing.T) {
+	srv, close := mock.NewServer()
+	defer close()
+	srv.AppendResponse(mock.WithBody([]byte(provStateFailed)))
+	resp, closed := initialResponse(http.MethodPut, srv.URL(), strings.NewReader(provStateStarted))
+	resp.Header.Set(shared.HeaderAzureAsync, srv.URL())
+	resp.StatusCode = http.StatusCreated
+	pl := getPipeline(srv)
+	poller, err := NewPoller[mockType](resp, pl, nil)
+	if err != nil {
+		t.Fatal(err)
+	}
+	if !closed() {
+		t.Fatal("initial response body wasn't closed")
+	}
+	if pt := typeOfOpField(poller); pt != reflect.TypeOf((*async.Poller[mockType])(nil)) {
+		t.Fatalf("unexpected poller type %s", pt.String())
+	}
+	_, err = poller.PollUntilDone(context.Background(), &PollUntilDoneOptions{Frequency: time.Millisecond})
+	if err == nil {
+		t.Fatal(err)
+	}
+}
+
 func TestNewPollerFailedWithError(t *testing.T) {
 	srv, close := mock.NewServer()
 	defer close()
diff --git a/sdk/data/aztables/service_client_test.go b/sdk/data/aztables/service_client_test.go
index 61b5c8eea6..dcd6424883 100644
--- a/sdk/data/aztables/service_client_test.go
+++ b/sdk/data/aztables/service_client_test.go
@@ -75,7 +75,7 @@ func TestQueryTable(t *testing.T) {
 			prefix1 := "zzza"
 			prefix2 := "zzzb"
 
-			defer clearAllTables(service) //nolint
+			defer require.NoError(t, clearAllTables(service))
 			//create 10 tables with our exected prefix and 1 with a different prefix
 			for i := 0; i < tableCount; i++ {
 				if i < (tableCount - 1) {
diff --git a/sdk/data/aztables/shared_access_signature_test.go b/sdk/data/aztables/shared_access_signature_test.go
index 3857b8985c..61004107be 100644
--- a/sdk/data/aztables/shared_access_signature_test.go
+++ b/sdk/data/aztables/shared_access_signature_test.go
@@ -60,7 +60,7 @@ func TestSASServiceClient(t *testing.T) {
 	require.NoError(t, err)
 	svcClient, err := createServiceClientForRecordingWithNoCredential(t, sasUrl)
 	require.NoError(t, err)
-	defer recording.Stop(t, nil) //nolint
+	defer require.NoError(t, recording.Stop(t, nil))
 
 	_, err = svcClient.CreateTable(ctx, tableName+"002", nil)
 	require.NoError(t, err)
@@ -106,7 +106,7 @@ func TestSASClient(t *testing.T) {
 	require.NoError(t, err)
 	client, err := createClientForRecordingWithNoCredential(t, "", sasUrl)
 	require.NoError(t, err)
-	defer recording.Stop(t, nil) //nolint
+	defer require.NoError(t, recording.Stop(t, nil))
 
 	entity := map[string]string{
 		"PartitionKey": "pk001",
@@ -160,7 +160,7 @@ func TestSASClientReadOnly(t *testing.T) {
 	require.NoError(t, err)
 	client, err = createClientForRecordingWithNoCredential(t, "", sasUrl)
 	require.NoError(t, err)
-	defer recording.Stop(t, nil) //nolint
+	defer require.NoError(t, recording.Stop(t, nil))
 
 	entity := map[string]string{
 		"PartitionKey": "pk001",
@@ -229,7 +229,7 @@ func TestSASCosmosClientReadOnly(t *testing.T) {
 	require.NoError(t, err)
 	client, err = createClientForRecordingWithNoCredential(t, "", sasUrl)
 	require.NoError(t, err)
-	defer recording.Stop(t, nil) //nolint
+	defer require.NoError(t, recording.Stop(t, nil))
 
 	entity := map[string]string{
 		"PartitionKey": "pk001",
diff --git a/sdk/storage/azblob/appendblob/client_test.go b/sdk/storage/azblob/appendblob/client_test.go
index b253f15ac4..6c6a95ae35 100644
--- a/sdk/storage/azblob/appendblob/client_test.go
+++ b/sdk/storage/azblob/appendblob/client_test.go
@@ -41,22 +41,18 @@ func Test(t *testing.T) {
 	}
 }
 
-// nolint
 func (s *AppendBlobRecordedTestsSuite) BeforeTest(suite string, test string) {
 	testcommon.BeforeTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *AppendBlobRecordedTestsSuite) AfterTest(suite string, test string) {
 	testcommon.AfterTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *AppendBlobUnrecordedTestsSuite) BeforeTest(suite string, test string) {
 
 }
 
-// nolint
 func (s *AppendBlobUnrecordedTestsSuite) AfterTest(suite string, test string) {
 
 }
@@ -82,7 +78,6 @@ func createNewAppendBlob(ctx context.Context, _require *require.Assertions, appe
 	return abClient
 }
 
-// nolint
 func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlock() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -120,7 +115,6 @@ func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlock() {
 	_require.Equal(*appendResp.BlobCommittedBlockCount, int32(2))
 }
 
-// nolint
 func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockWithMD5() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -172,7 +166,6 @@ func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockWithMD5() {
 	testcommon.ValidateBlobErrorCode(_require, err, bloberror.MD5Mismatch)
 }
 
-//nolint
 //func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockFromURL() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -268,7 +261,6 @@ func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockWithMD5() {
 //	_ = downloadresp.BodyReader(nil).Close()
 //}
 
-//nolint
 //func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockFromURLWithMD5() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -1219,7 +1211,6 @@ func (s *AppendBlobRecordedTestsSuite) TestSeal() {
 }
 
 // TODO: Learn about the behaviour of AppendPosition
-// nolint
 //func (s *AppendBlobUnrecordedTestsSuite) TestSealWithAppendConditions() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -1563,7 +1554,6 @@ func (s *AppendBlobRecordedTestsSuite) TestAppendBlockWithCPKScope() {
 	_require.EqualValues(*downloadResp.EncryptionScope, *encryptionScope.EncryptionScope)
 }
 
-//nolint
 //func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockFromURLWithCPK() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -1673,7 +1663,6 @@ func (s *AppendBlobRecordedTestsSuite) TestAppendBlockWithCPKScope() {
 //	_require.EqualValues(destData, srcData)
 //}
 
-//nolint
 //func (s *AppendBlobUnrecordedTestsSuite) TestAppendBlockFromURLWithCPKScope() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
diff --git a/sdk/storage/azblob/blob/client_test.go b/sdk/storage/azblob/blob/client_test.go
index 11b9d9c5eb..1f1cfd6475 100644
--- a/sdk/storage/azblob/blob/client_test.go
+++ b/sdk/storage/azblob/blob/client_test.go
@@ -46,22 +46,18 @@ func Test(t *testing.T) {
 	}
 }
 
-// nolint
 func (s *BlobRecordedTestsSuite) BeforeTest(suite string, test string) {
 	testcommon.BeforeTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *BlobRecordedTestsSuite) AfterTest(suite string, test string) {
 	testcommon.AfterTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *BlobUnrecordedTestsSuite) BeforeTest(suite string, test string) {
 
 }
 
-// nolint
 func (s *BlobUnrecordedTestsSuite) AfterTest(suite string, test string) {
 
 }
@@ -74,7 +70,6 @@ type BlobUnrecordedTestsSuite struct {
 	suite.Suite
 }
 
-// nolint
 func (s *BlobUnrecordedTestsSuite) TestCreateBlobClient() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -98,7 +93,6 @@ func (s *BlobUnrecordedTestsSuite) TestCreateBlobClient() {
 	_require.Equal(bbClient.URL(), correctURL)
 }
 
-// nolint
 func (s *BlobUnrecordedTestsSuite) TestCreateBlobClientWithSnapshotAndSAS() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -141,7 +135,6 @@ func (s *BlobUnrecordedTestsSuite) TestCreateBlobClientWithSnapshotAndSAS() {
 	_require.Equal(blobURLParts, correctURL)
 }
 
-// nolint
 func (s *BlobUnrecordedTestsSuite) TestCreateBlobClientWithSnapshotAndSASUsingConnectionString() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -406,7 +399,6 @@ func (s *BlobRecordedTestsSuite) TestBlobStartCopySourcePrivate() {
 	testcommon.ValidateBlobErrorCode(_require, err, bloberror.CannotVerifyCopySource)
 }
 
-////nolint
 //func (s *BlobUnrecordedTestsSuite) TestBlobStartCopyUsingSASSrc() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -482,7 +474,6 @@ func (s *BlobRecordedTestsSuite) TestBlobStartCopySourcePrivate() {
 //	_ = resp2.Body(nil).Close()
 //}
 
-// nolint
 func (s *BlobUnrecordedTestsSuite) TestBlobStartCopyUsingSASDest() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -1010,7 +1001,6 @@ func (s *BlobRecordedTestsSuite) TestBlobStartCopyDestIfNoneMatchFalse() {
 	testcommon.ValidateBlobErrorCode(_require, err, bloberror.TargetConditionNotMet)
 }
 
-// nolint
 func (s *BlobUnrecordedTestsSuite) TestBlobAbortCopyInProgress() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -3175,7 +3165,6 @@ func (s *BlobRecordedTestsSuite) TestBlobClientPartsSASQueryTimes() {
 	}
 }
 
-////nolint
 //func (s *BlobUnrecordedTestsSuite) TestDownloadBlockBlobUnexpectedEOF() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -3209,7 +3198,6 @@ func (s *BlobRecordedTestsSuite) TestBlobClientPartsSASQueryTimes() {
 //	_require.EqualValues(buf, []byte(testcommon.BlockBlobDefaultData))
 //}
 
-////nolint
 //func InjectErrorInRetryReaderOptions(err error) *blob.RetryReaderOptions {
 //	return &blob.RetryReaderOptions{
 //		MaxRetryRequests:       1,
diff --git a/sdk/storage/azblob/blob/retry_reader_test.go b/sdk/storage/azblob/blob/retry_reader_test.go
index b4f1d4ef5b..e280a38193 100644
--- a/sdk/storage/azblob/blob/retry_reader_test.go
+++ b/sdk/storage/azblob/blob/retry_reader_test.go
@@ -22,7 +22,6 @@ import (
 
 // Testings for RetryReader
 // This reader return one byte through each Read call
-// nolint
 type perByteReader struct {
 	RandomBytes []byte // Random generated bytes
 
@@ -38,7 +37,6 @@ type perByteReader struct {
 	closeChannel  chan struct{}
 }
 
-// nolint
 func newPerByteReader(byteCount int) *perByteReader {
 	perByteReader := perByteReader{
 		byteCount:    byteCount,
@@ -51,7 +49,6 @@ func newPerByteReader(byteCount int) *perByteReader {
 	return &perByteReader
 }
 
-// nolint
 func newSingleUsePerByteReader(contents []byte) *perByteReader {
 	perByteReader := perByteReader{
 		byteCount:    len(contents),
@@ -63,7 +60,6 @@ func newSingleUsePerByteReader(contents []byte) *perByteReader {
 	return &perByteReader
 }
 
-// nolint
 func (r *perByteReader) Read(b []byte) (n int, err error) {
 	if r.doInjectError && r.doInjectErrorByteIndex == r.currentByteIndex && r.doInjectTimes > 0 {
 		r.doInjectTimes--
@@ -87,7 +83,6 @@ func (r *perByteReader) Read(b []byte) (n int, err error) {
 	return 0, io.EOF
 }
 
-// nolint
 func (r *perByteReader) Close() error {
 	if r.closeChannel != nil {
 		r.closeChannel <- struct{}{}
@@ -97,7 +92,6 @@ func (r *perByteReader) Close() error {
 
 // Test normal retry succeed, note initial response not provided.
 // Tests both with and without notification of failures
-// nolint
 func TestRetryReaderReadWithRetry(t *testing.T) {
 	// Test twice, the second time using the optional "logging"/notification callback for failed tries
 	// We must test both with and without the callback, since be testing without
@@ -172,7 +166,6 @@ func TestRetryReaderReadWithRetry(t *testing.T) {
 
 // Test normal retry succeed, note initial response not provided.
 // Tests both with and without notification of failures
-// nolint
 func TestRetryReaderWithRetryIoUnexpectedEOF(t *testing.T) {
 	// Test twice, the second time using the optional "logging"/notification callback for failed tries
 	// We must test both with and without the callback, since be testing without
@@ -246,7 +239,6 @@ func TestRetryReaderWithRetryIoUnexpectedEOF(t *testing.T) {
 }
 
 // Test normal retry fail as retry Count not enough.
-// nolint
 func TestRetryReaderReadNegativeNormalFail(t *testing.T) {
 	// Extra setup for testing notification of failures (i.e. of unsuccessful tries)
 	failureMethodNumCalls := 0
@@ -307,7 +299,6 @@ func TestRetryReaderReadNegativeNormalFail(t *testing.T) {
 }
 
 // Test boundary case when Count equals to 0 and fail.
-// nolint
 func TestRetryReaderReadCount0(t *testing.T) {
 	byteCount := 1
 	body := newPerByteReader(byteCount)
@@ -346,7 +337,6 @@ func TestRetryReaderReadCount0(t *testing.T) {
 	require.Equal(t, err, io.EOF)
 }
 
-// nolint
 func TestRetryReaderReadNegativeNonRetriableError(t *testing.T) {
 	byteCount := 1
 	body := newPerByteReader(byteCount)
@@ -383,7 +373,6 @@ func TestRetryReaderReadNegativeNonRetriableError(t *testing.T) {
 // 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
 func TestRetryReaderReadWithForcedRetry(t *testing.T) {
 	for _, enableRetryOnEarlyClose := range []bool{false, true} {
 
diff --git a/sdk/storage/azblob/blockblob/client_test.go b/sdk/storage/azblob/blockblob/client_test.go
index 972eed99f1..8b4228016f 100644
--- a/sdk/storage/azblob/blockblob/client_test.go
+++ b/sdk/storage/azblob/blockblob/client_test.go
@@ -49,22 +49,18 @@ func Test(t *testing.T) {
 	}
 }
 
-// nolint
 func (s *BlockBlobRecordedTestsSuite) BeforeTest(suite string, test string) {
 	testcommon.BeforeTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *BlockBlobRecordedTestsSuite) AfterTest(suite string, test string) {
 	testcommon.AfterTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) BeforeTest(suite string, test string) {
 
 }
 
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) AfterTest(suite string, test string) {
 
 }
@@ -80,7 +76,9 @@ type BlockBlobUnrecordedTestsSuite struct {
 //	func (s *BlockBlobRecordedTestsSuite) TestStageGetBlocks() {
 //		_require := require.New(s.T())
 //		testName := s.T().Name()
-//	//		svcClient, err := testcommon.GetServiceClient(s.T(), testcommon.TestAccountDefault, nil)
+//
+// //		svcClient, err := testcommon.GetServiceClient(s.T(), testcommon.TestAccountDefault, nil)
+//
 //		if err != nil {
 //			s.Fail("Unable to fetch service client because " + err.Error())
 //		}
@@ -153,8 +151,6 @@ type BlockBlobUnrecordedTestsSuite struct {
 //		_require.Len(blockList.BlockList.CommittedBlocks, len(data))
 //	}
 //
-// //nolint
-//
 //	func (s *BlockBlobUnrecordedTestsSuite) TestStageBlockFromURL() {
 //		_require := require.New(s.T())
 //		testName := s.T().Name()
@@ -253,8 +249,6 @@ type BlockBlobUnrecordedTestsSuite struct {
 //		_require.EqualValues(destData, content)
 //	}
 //
-// //nolint
-//
 //	func (s *BlockBlobUnrecordedTestsSuite) TestCopyBlockBlobFromURL() {
 //		_require := require.New(s.T())
 //		testName := s.T().Name()
@@ -350,8 +344,6 @@ type BlockBlobUnrecordedTestsSuite struct {
 //		_require.EqualValues(*resp.CopyStatus, "success")
 //	}
 //
-// //nolint
-//
 //	func (s *BlockBlobUnrecordedTestsSuite) TestBlobSASQueryParamOverrideResponseHeaders() {
 //		_require := require.New(s.T())
 //		testName := s.T().Name()
@@ -418,8 +410,6 @@ type BlockBlobUnrecordedTestsSuite struct {
 //		_require.Equal(*gResp.ContentLanguage, contentLanguageVal)
 //		_require.Equal(*gResp.ContentType, contentTypeVal)
 //	}
-//
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) TestStageBlockWithMD5() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -1143,7 +1133,6 @@ func (s *BlockBlobRecordedTestsSuite) TestBlobSetTierOnCommit() {
 	}
 }
 
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) TestSetTierOnCopyBlockBlobFromURL() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -1204,7 +1193,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestSetTierOnCopyBlockBlobFromURL() {
 	}
 }
 
-////nolint
 //func (s *BlockBlobUnrecordedTestsSuite) TestSetTierOnStageBlockFromURL() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -1808,7 +1796,6 @@ func (s *BlockBlobRecordedTestsSuite) TestPutBlockListReturnsVID() {
 	_require.EqualValues(contentData, []uint8(strings.Join(data, "")))
 }
 
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) TestCreateBlockBlobReturnsVID() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2039,7 +2026,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestSetBlobTags() {
 	}
 }
 
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) TestSetBlobTagsWithLeaseId() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2093,7 +2079,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestSetBlobTagsWithLeaseId() {
 	}
 }
 
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) TestSetBlobTagsWithVID() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2148,7 +2133,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestSetBlobTagsWithVID() {
 	_require.Nil(blobGetTagsResponse.BlobTagSet)
 }
 
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) TestUploadBlockBlobWithSpecialCharactersInTags() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2186,7 +2170,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestUploadBlockBlobWithSpecialCharacters
 	}
 }
 
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) TestStageBlockWithTags() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2252,7 +2235,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestStageBlockWithTags() {
 }
 
 //
-////nolint
 //func (s *BlockBlobUnrecordedTestsSuite) TestStageBlockFromURLWithTags() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -2361,7 +2343,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestStageBlockWithTags() {
 //	_require.EqualValues(destData, sourceData)
 //}
 
-//nolint
 //func (s *BlockBlobUnrecordedTestsSuite) TestCopyBlockBlobFromURLWithTags() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -2450,7 +2431,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestStageBlockWithTags() {
 //	// _require.Equal(resp.RawResponse.StatusCode, 202)
 //}
 
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) TestGetPropertiesReturnsTagsCount() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2480,7 +2460,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestGetPropertiesReturnsTagsCount() {
 	_require.Equal(*downloadResp.TagCount, int64(3))
 }
 
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) TestSetBlobTagForSnapshot() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2511,7 +2490,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestSetBlobTagForSnapshot() {
 }
 
 // TODO: Once new pacer is done.
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) TestListBlobReturnsTags() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2555,7 +2533,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestListBlobReturnsTags() {
 }
 
 //
-////nolint
 //func (s *BlockBlobUnrecordedTestsSuite) TestFindBlobsByTags() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -2628,7 +2605,6 @@ func (s *BlockBlobUnrecordedTestsSuite) TestListBlobReturnsTags() {
 //	}
 //}
 //
-//nolint
 //func (s *BlockBlobUnrecordedTestsSuite) TestFilterBlobsUsingAccountSAS() {
 //	accountName, accountKey := accountInfo()
 //	credential, err := NewSharedKeyCredential(accountName, accountKey)
@@ -2794,7 +2770,6 @@ func (s *BlockBlobRecordedTestsSuite) TestPutBlockAndPutBlockListWithCPKByScope(
 }
 
 //
-////nolint
 //func (s *BlockBlobUnrecordedTestsSuite) TestPutBlockFromURLAndCommitWithCPK() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -2912,7 +2887,6 @@ func (s *BlockBlobRecordedTestsSuite) TestPutBlockAndPutBlockListWithCPKByScope(
 //	_require.EqualValues(*downloadResp.EncryptionKeySHA256, *testcommon.TestCPKByValue.EncryptionKeySHA256)
 //}
 
-//nolint
 //func (s *BlockBlobUnrecordedTestsSuite) TestPutBlockFromURLAndCommitWithCPKWithScope() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -3025,7 +2999,6 @@ func (s *BlockBlobRecordedTestsSuite) TestPutBlockAndPutBlockListWithCPKByScope(
 //	_require.EqualValues(*downloadResp.EncryptionScope, *testcommon.TestCPKByScope.EncryptionScope)
 //}
 
-// nolint
 func (s *BlockBlobUnrecordedTestsSuite) TestUploadBlobWithMD5WithCPK() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -3169,7 +3142,6 @@ func (s *BlockBlobRecordedTestsSuite) TestUploadBlobWithMD5WithCPKScope() {
 //	_require.EqualValues(actualBlobData, blobData)
 //}
 
-//nolint
 //func (s *AZBlobUnrecordedTestsSuite) TestUploadStreamToBlobBlobPropertiesWithCPKScope() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
diff --git a/sdk/storage/azblob/client_test.go b/sdk/storage/azblob/client_test.go
index cb90678c53..ef24c36c7d 100644
--- a/sdk/storage/azblob/client_test.go
+++ b/sdk/storage/azblob/client_test.go
@@ -51,28 +51,23 @@ func Test(t *testing.T) {
 	}
 }
 
-// nolint
 func (s *AZBlobRecordedTestsSuite) BeforeTest(suite string, test string) {
 	testcommon.BeforeTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *AZBlobRecordedTestsSuite) AfterTest(suite string, test string) {
 	testcommon.AfterTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) BeforeTest(suite string, test string) {
 
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) AfterTest(suite string, test string) {
 
 }
 
 // create a test file
-// nolint
 func generateFile(fileName string, fileSize int) []byte {
 	// generate random data
 	_, bigBuff := testcommon.GenerateData(fileSize)
@@ -82,7 +77,6 @@ func generateFile(fileName string, fileSize int) []byte {
 	return bigBuff
 }
 
-// nolint
 func performUploadStreamToBlockBlobTest(t *testing.T, _require *require.Assertions, testName string, blobSize, bufferSize, maxBuffers int) {
 	client, err := testcommon.GetClient(t, testcommon.TestAccountDefault, nil)
 	_require.NoError(err)
@@ -120,7 +114,6 @@ func performUploadStreamToBlockBlobTest(t *testing.T, _require *require.Assertio
 	_require.EqualValues(actualBlobData, blobData)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadStreamToBlockBlobInChunks() {
 	blobSize := 8 * 1024
 	bufferSize := 1024
@@ -130,7 +123,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadStreamToBlockBlobInChunks() {
 	performUploadStreamToBlockBlobTest(s.T(), _require, testName, blobSize, bufferSize, maxBuffers)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadStreamToBlockBlobSingleBuffer() {
 	blobSize := 8 * 1024
 	bufferSize := 1024
@@ -140,7 +132,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadStreamToBlockBlobSingleBuffer() {
 	performUploadStreamToBlockBlobTest(s.T(), _require, testName, blobSize, bufferSize, maxBuffers)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadStreamToBlockBlobSingleIO() {
 	blobSize := 1024
 	bufferSize := 8 * 1024
@@ -150,7 +141,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadStreamToBlockBlobSingleIO() {
 	performUploadStreamToBlockBlobTest(s.T(), _require, testName, blobSize, bufferSize, maxBuffers)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadStreamToBlockBlobSingleIOEdgeCase() {
 	blobSize := 8 * 1024
 	bufferSize := 8 * 1024
@@ -160,7 +150,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadStreamToBlockBlobSingleIOEdgeCase
 	performUploadStreamToBlockBlobTest(s.T(), _require, testName, blobSize, bufferSize, maxBuffers)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadStreamToBlockBlobEmpty() {
 	blobSize := 0
 	bufferSize := 8 * 1024
@@ -170,7 +159,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadStreamToBlockBlobEmpty() {
 	performUploadStreamToBlockBlobTest(s.T(), _require, testName, blobSize, bufferSize, maxBuffers)
 }
 
-// nolint
 func performUploadAndDownloadFileTest(t *testing.T, _require *require.Assertions, testName string, fileSize, blockSize, concurrency, downloadOffset, downloadCount int) {
 	// Set up file to upload
 	fileName := "BigFile.bin"
@@ -278,7 +266,6 @@ func performUploadAndDownloadFileTest(t *testing.T, _require *require.Assertions
 	}
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileInChunks() {
 	fileSize := 8 * 1024
 	blockSize := 1024
@@ -288,7 +275,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileInChunks() {
 	performUploadAndDownloadFileTest(s.T(), _require, testName, fileSize, blockSize, concurrency, 0, 0)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileSingleIO() {
 	fileSize := 1024
 	blockSize := 2048
@@ -298,7 +284,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileSingleIO() {
 	performUploadAndDownloadFileTest(s.T(), _require, testName, fileSize, blockSize, concurrency, 0, 0)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileSingleRoutine() {
 	fileSize := 8 * 1024
 	blockSize := 1024
@@ -308,7 +293,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileSingleRoutine() {
 	performUploadAndDownloadFileTest(s.T(), _require, testName, fileSize, blockSize, concurrency, 0, 0)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileEmpty() {
 	fileSize := 0
 	blockSize := 1024
@@ -318,7 +302,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileEmpty() {
 	performUploadAndDownloadFileTest(s.T(), _require, testName, fileSize, blockSize, concurrency, 0, 0)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileNonZeroOffset() {
 	fileSize := 8 * 1024
 	blockSize := 1024
@@ -330,7 +313,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileNonZeroOffset() {
 	performUploadAndDownloadFileTest(s.T(), _require, testName, fileSize, blockSize, concurrency, downloadOffset, downloadCount)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileNonZeroCount() {
 	fileSize := 8 * 1024
 	blockSize := 1024
@@ -342,7 +324,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileNonZeroCount() {
 	performUploadAndDownloadFileTest(s.T(), _require, testName, fileSize, blockSize, concurrency, downloadOffset, downloadCount)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileNonZeroOffsetAndCount() {
 	fileSize := 8 * 1024
 	blockSize := 1024
@@ -354,7 +335,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadFileNonZeroOffsetAndCo
 	performUploadAndDownloadFileTest(s.T(), _require, testName, fileSize, blockSize, concurrency, downloadOffset, downloadCount)
 }
 
-// nolint
 func performUploadAndDownloadBufferTest(t *testing.T, _require *require.Assertions, testName string, blobSize, blockSize, concurrency, downloadOffset, downloadCount int) {
 	// Set up buffer to upload
 	_, bytesToUpload := testcommon.GenerateData(blobSize)
@@ -433,7 +413,6 @@ func performUploadAndDownloadBufferTest(t *testing.T, _require *require.Assertio
 	}
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadBufferInChunks() {
 	blobSize := 8 * 1024
 	blockSize := 1024
@@ -443,7 +422,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadBufferInChunks() {
 	performUploadAndDownloadBufferTest(s.T(), _require, testName, blobSize, blockSize, concurrency, 0, 0)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadBufferSingleIO() {
 	blobSize := 1024
 	blockSize := 8 * 1024
@@ -453,7 +431,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadBufferSingleIO() {
 	performUploadAndDownloadBufferTest(s.T(), _require, testName, blobSize, blockSize, concurrency, 0, 0)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadBufferSingleRoutine() {
 	blobSize := 8 * 1024
 	blockSize := 1024
@@ -463,7 +440,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadBufferSingleRoutine()
 	performUploadAndDownloadBufferTest(s.T(), _require, testName, blobSize, blockSize, concurrency, 0, 0)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadBufferEmpty() {
 	blobSize := 0
 	blockSize := 1024
@@ -473,7 +449,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestUploadAndDownloadBufferEmpty() {
 	performUploadAndDownloadBufferTest(s.T(), _require, testName, blobSize, blockSize, concurrency, 0, 0)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestDownloadBufferWithNonZeroOffset() {
 	blobSize := 8 * 1024
 	blockSize := 1024
@@ -485,7 +460,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestDownloadBufferWithNonZeroOffset() {
 	performUploadAndDownloadBufferTest(s.T(), _require, testName, blobSize, blockSize, concurrency, downloadOffset, downloadCount)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestDownloadBufferWithNonZeroCount() {
 	blobSize := 8 * 1024
 	blockSize := 1024
@@ -497,7 +471,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestDownloadBufferWithNonZeroCount() {
 	performUploadAndDownloadBufferTest(s.T(), _require, testName, blobSize, blockSize, concurrency, downloadOffset, downloadCount)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestDownloadBufferWithNonZeroOffsetAndCount() {
 	blobSize := 8 * 1024
 	blockSize := 1024
@@ -509,7 +482,6 @@ func (s *AZBlobUnrecordedTestsSuite) TestDownloadBufferWithNonZeroOffsetAndCount
 	performUploadAndDownloadBufferTest(s.T(), _require, testName, blobSize, blockSize, concurrency, downloadOffset, downloadCount)
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestBasicDoBatchTransfer() {
 	_require := require.New(s.T())
 	// test the basic multi-routine processing
@@ -559,14 +531,12 @@ func (s *AZBlobUnrecordedTestsSuite) TestBasicDoBatchTransfer() {
 }
 
 // mock a memory mapped file (low-quality mock, meant to simulate the scenario only)
-// nolint
 type mockMMF struct {
 	isClosed   bool
 	failHandle *require.Assertions
 }
 
 // accept input
-// nolint
 func (m *mockMMF) write(_ string) {
 	if m.isClosed {
 		// simulate panic
@@ -574,7 +544,6 @@ func (m *mockMMF) write(_ string) {
 	}
 }
 
-// nolint
 func (s *AZBlobUnrecordedTestsSuite) TestDoBatchTransferWithError() {
 	_require := require.New(s.T())
 	ctx := context.Background()
diff --git a/sdk/storage/azblob/container/client_test.go b/sdk/storage/azblob/container/client_test.go
index c5fbed2042..e9617aecb1 100644
--- a/sdk/storage/azblob/container/client_test.go
+++ b/sdk/storage/azblob/container/client_test.go
@@ -42,22 +42,18 @@ func Test(t *testing.T) {
 	}
 }
 
-// nolint
 func (s *ContainerRecordedTestsSuite) BeforeTest(suite string, test string) {
 	testcommon.BeforeTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *ContainerRecordedTestsSuite) AfterTest(suite string, test string) {
 	testcommon.AfterTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *ContainerUnrecordedTestsSuite) BeforeTest(suite string, test string) {
 
 }
 
-// nolint
 func (s *ContainerUnrecordedTestsSuite) AfterTest(suite string, test string) {
 
 }
@@ -70,7 +66,6 @@ type ContainerUnrecordedTestsSuite struct {
 	suite.Suite
 }
 
-//nolint
 //func (s *ContainerUnrecordedTestsSuite) TestNewContainerClientValidName() {
 //	_require := require.New(s.T())
 //	svcClient, err := testcommon.GetServiceClient(s.T(), testcommon.TestAccountDefault, nil)
@@ -85,7 +80,6 @@ type ContainerUnrecordedTestsSuite struct {
 //	_require.Equal(testURL.URL(), correctURL)
 //}
 
-//nolint
 //func (s *ContainerUnrecordedTestsSuite) TestCreateRootContainerURL() {
 //	_require := require.New(s.T())
 //	svcClient, err := testcommon.GetServiceClient(s.T(), testcommon.TestAccountDefault, nil)
@@ -1358,7 +1352,6 @@ func (s *ContainerUnrecordedTestsSuite) TestSetEmptyAccessPolicy() {
 	_require.Nil(err)
 }
 
-// nolint
 func (s *ContainerUnrecordedTestsSuite) TestSetAccessPolicy() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -1389,7 +1382,6 @@ func (s *ContainerUnrecordedTestsSuite) TestSetAccessPolicy() {
 	_require.Nil(err)
 }
 
-// nolint
 func (s *ContainerUnrecordedTestsSuite) TestSetMultipleAccessPolicies() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -1440,7 +1432,6 @@ func (s *ContainerUnrecordedTestsSuite) TestSetMultipleAccessPolicies() {
 	_require.Len(resp.SignedIdentifiers, 3)
 }
 
-// nolint
 func (s *ContainerUnrecordedTestsSuite) TestSetNullAccessPolicy() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
diff --git a/sdk/storage/azblob/internal/shared/transfer_manager_test.go b/sdk/storage/azblob/internal/shared/transfer_manager_test.go
new file mode 100644
index 0000000000..fc16274fba
--- /dev/null
+++ b/sdk/storage/azblob/internal/shared/transfer_manager_test.go
@@ -0,0 +1,32 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+package shared
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/require"
+)
+
+func TestNewSyncPool(t *testing.T) {
+	sp, err := NewSyncPool(_1MiB, 4)
+	require.NoError(t, err)
+	require.NotNil(t, sp)
+
+	buf := sp.Get()
+	require.Len(t, buf, _1MiB)
+
+	const _2MiB = _1MiB * 2
+	sp.Put(make([]byte, _2MiB))
+
+	buf = sp.Get()
+
+	// buf is either 1 or 2 MB depending on what sync.Pool decides to do
+	if l := len(buf); l != _2MiB && l != _1MiB {
+		t.Fatalf("unexpected length %d", l)
+	}
+}
diff --git a/sdk/storage/azblob/internal/testcommon/common.go b/sdk/storage/azblob/internal/testcommon/common.go
index 7eea029be6..c482aea9b4 100644
--- a/sdk/storage/azblob/internal/testcommon/common.go
+++ b/sdk/storage/azblob/internal/testcommon/common.go
@@ -47,7 +47,6 @@ func GenerateContainerName(testName 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
 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
diff --git a/sdk/storage/azblob/lease/client_test.go b/sdk/storage/azblob/lease/client_test.go
index 7d15617553..2d0f41053d 100644
--- a/sdk/storage/azblob/lease/client_test.go
+++ b/sdk/storage/azblob/lease/client_test.go
@@ -33,22 +33,18 @@ func Test(t *testing.T) {
 	}
 }
 
-// nolint
 func (s *LeaseRecordedTestsSuite) BeforeTest(suite string, test string) {
 	testcommon.BeforeTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *LeaseRecordedTestsSuite) AfterTest(suite string, test string) {
 	testcommon.AfterTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *LeaseUnrecordedTestsSuite) BeforeTest(suite string, test string) {
 
 }
 
-// nolint
 func (s *LeaseUnrecordedTestsSuite) AfterTest(suite string, test string) {
 
 }
diff --git a/sdk/storage/azblob/pageblob/client_test.go b/sdk/storage/azblob/pageblob/client_test.go
index 53c71f9f02..87ddab900f 100644
--- a/sdk/storage/azblob/pageblob/client_test.go
+++ b/sdk/storage/azblob/pageblob/client_test.go
@@ -39,22 +39,18 @@ func Test(t *testing.T) {
 	}
 }
 
-// nolint
 func (s *PageBlobRecordedTestsSuite) BeforeTest(suite string, test string) {
 	testcommon.BeforeTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *PageBlobRecordedTestsSuite) AfterTest(suite string, test string) {
 	testcommon.AfterTest(s.T(), suite, test)
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) BeforeTest(suite string, test string) {
 
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) AfterTest(suite string, test string) {
 
 }
@@ -156,7 +152,6 @@ func (s *PageBlobRecordedTestsSuite) TestPutGetPages() {
 	}
 }
 
-//nolint
 //func (s *PageBlobUnrecordedTestsSuite) TestUploadPagesFromURL() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -228,7 +223,6 @@ func (s *PageBlobRecordedTestsSuite) TestPutGetPages() {
 //	_require.EqualValues(destData, sourceData)
 //}
 //
-////nolint
 //func (s *PageBlobUnrecordedTestsSuite) TestUploadPagesFromURLWithMD5() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -310,7 +304,6 @@ func (s *PageBlobRecordedTestsSuite) TestPutGetPages() {
 //	testcommon.ValidateBlobErrorCode(_require, err, bloberror.MD5Mismatch)
 //}
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestClearDiffPages() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -388,7 +381,6 @@ func (s *PageBlobUnrecordedTestsSuite) TestClearDiffPages() {
 	}
 }
 
-// nolint
 func waitForIncrementalCopy(_require *require.Assertions, copyBlobClient *pageblob.Client, blobCopyResponse *pageblob.CopyIncrementalResponse) *string {
 	status := *blobCopyResponse.CopyStatus
 	var getPropertiesAndMetadataResult blob.GetPropertiesResponse
@@ -405,7 +397,6 @@ func waitForIncrementalCopy(_require *require.Assertions, copyBlobClient *pagebl
 	return getPropertiesAndMetadataResult.DestinationSnapshot
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestIncrementalCopy() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -517,7 +508,6 @@ func (s *PageBlobRecordedTestsSuite) TestPageSequenceNumbers() {
 	_require.Nil(err)
 }
 
-//nolint
 //func (s *PageBlobUnrecordedTestsSuite) TestPutPagesWithMD5() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -996,7 +986,6 @@ func (s *PageBlobRecordedTestsSuite) TestBlobCreatePageIfNoneMatchFalse() {
 	testcommon.ValidateBlobErrorCode(_require, err, bloberror.ConditionNotMet)
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestBlobPutPagesInvalidRange() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2457,7 +2446,6 @@ func (s *PageBlobRecordedTestsSuite) TestBlobGetPageRangesIfNoneMatchFalse() {
 	//_require.(serr.RawResponse.StatusCode, chk.Equals, 304) // Service Code not returned in the body for a HEAD
 }
 
-// nolint
 func setupDiffPageRangesTest(t *testing.T, _require *require.Assertions, testName string) (containerClient *container.Client, pbClient *pageblob.Client, snapshot string) {
 	svcClient, err := testcommon.GetServiceClient(t, testcommon.TestAccountDefault, nil)
 	_require.NoError(err)
@@ -2511,7 +2499,6 @@ func validateDiffPageRanges(_require *require.Assertions, resp pageblob.PageList
 	_require.EqualValues(rawEnd, int64(pageblob.PageBytes-1))
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangesNonExistentSnapshot() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2533,7 +2520,6 @@ func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangesNonExistentSnapshot
 
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeInvalidRange() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2555,7 +2541,6 @@ func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeInvalidRange() {
 	}
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfModifiedSinceTrue() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2579,7 +2564,6 @@ func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfModifiedSinceTrue(
 	}
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfModifiedSinceFalse() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2607,7 +2591,6 @@ func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfModifiedSinceFalse
 
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfUnmodifiedSinceTrue() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2632,7 +2615,6 @@ func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfUnmodifiedSinceTru
 	}
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfUnmodifiedSinceFalse() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2658,7 +2640,6 @@ func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfUnmodifiedSinceFal
 
 }
 
-////nolint
 //func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfMatchTrue() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -2686,7 +2667,6 @@ func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfUnmodifiedSinceFal
 //	}
 //}
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfMatchFalse() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2712,7 +2692,6 @@ func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfMatchFalse() {
 	}
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfNoneMatchTrue() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -2737,7 +2716,6 @@ func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfNoneMatchTrue() {
 	}
 }
 
-// nolint
 func (s *PageBlobUnrecordedTestsSuite) TestBlobDiffPageRangeIfNoneMatchFalse() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -3534,7 +3512,6 @@ func (s *PageBlobRecordedTestsSuite) TestBlobSetSequenceNumberIfNoneMatchFalse()
 //	testcommon.ValidateBlobErrorCode(_require, err, bloberror.ConditionNotMet)
 //}
 //
-//// nolint
 //func (s *PageBlobUnrecordedTestsSuite) TestBlobStartIncrementalCopyIfMatchTrue() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -3553,7 +3530,6 @@ func (s *PageBlobRecordedTestsSuite) TestBlobSetSequenceNumberIfNoneMatchFalse()
 //	defer testcommon.DeleteContainer(context.Background(), _require, containerClient)
 //}
 //
-////nolint
 //func (s *PageBlobUnrecordedTestsSuite) TestBlobStartIncrementalCopyIfMatchFalse() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -3573,7 +3549,6 @@ func (s *PageBlobRecordedTestsSuite) TestBlobSetSequenceNumberIfNoneMatchFalse()
 //	testcommon.ValidateBlobErrorCode(_require, err, bloberror.TargetConditionNotMet)
 //}
 
-////nolint
 //func (s *PageBlobUnrecordedTestsSuite) TestBlobStartIncrementalCopyIfNoneMatchTrue() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -3592,7 +3567,6 @@ func (s *PageBlobRecordedTestsSuite) TestBlobSetSequenceNumberIfNoneMatchFalse()
 //	validateIncrementalCopy(_require, copyPBClient, &resp)
 //}
 
-////nolint
 //func (s *PageBlobUnrecordedTestsSuite) TestBlobStartIncrementalCopyIfNoneMatchFalse() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -4000,7 +3974,6 @@ func (s *PageBlobRecordedTestsSuite) TestBlobResizeWithCPK() {
 //	_require.EqualValues(destData, srcData)
 //}
 
-//nolint
 //func (s *AZBlobUnrecordedTestsSuite) TestPageBlockFromURLWithCPKScope() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
@@ -4076,7 +4049,6 @@ func (s *PageBlobRecordedTestsSuite) TestBlobResizeWithCPK() {
 //	_require.EqualValues(destData, srcData)
 //}
 
-//nolint
 //func (s *AZBlobUnrecordedTestsSuite) TestUploadPagesFromURLWithMD5WithCPK() {
 //	_require := require.New(s.T())
 //	testName := s.T().Name()
diff --git a/sdk/storage/azblob/service/client_test.go b/sdk/storage/azblob/service/client_test.go
index 486ff22eda..2205d2c420 100644
--- a/sdk/storage/azblob/service/client_test.go
+++ b/sdk/storage/azblob/service/client_test.go
@@ -74,7 +74,6 @@ func (s *ServiceRecordedTestsSuite) TestGetAccountInfo() {
 	_require.NotZero(sAccInfo)
 }
 
-// nolint
 func (s *ServiceUnrecordedTestsSuite) TestServiceClientFromConnectionString() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -95,7 +94,6 @@ func (s *ServiceUnrecordedTestsSuite) TestServiceClientFromConnectionString() {
 	defer testcommon.DeleteContainer(context.Background(), _require, containerClient)
 }
 
-// nolint
 func (s *ServiceUnrecordedTestsSuite) TestListContainersBasic() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -156,7 +154,6 @@ func (s *ServiceUnrecordedTestsSuite) TestListContainersBasic() {
 	_require.GreaterOrEqual(count, 0)
 }
 
-// nolint
 func (s *ServiceUnrecordedTestsSuite) TestListContainersBasicUsingConnectionString() {
 	_require := require.New(s.T())
 	testName := s.T().Name()
@@ -458,7 +455,6 @@ func (s *ServiceRecordedTestsSuite) TestAccountDeleteRetentionPolicyDaysTooSmall
 	_require.NotNil(err)
 }
 
-// nolint
 func (s *ServiceUnrecordedTestsSuite) TestAccountDeleteRetentionPolicyDaysTooLarge() {
 	_require := require.New(s.T())
 	var svcClient *service.Client