refactor: remove redundant variable declarations in for loops (#4741)

This commit is contained in:
Milos Gajdos
2025-11-19 23:34:18 +00:00
committed by GitHub
8 changed files with 0 additions and 10 deletions

View File

@@ -104,7 +104,6 @@ func TestContentEncoding(t *testing.T) {
}
for _, tc := range tests {
tc := tc
t.Run(tc.encodingHeader, func(t *testing.T) {
t.Parallel()
content := make([]byte, 128)

View File

@@ -41,7 +41,6 @@ func TestWithTrace(t *testing.T) {
expected: f.Name(),
})
for _, tc := range tests {
tc := tc
t.Run(tc.key, func(t *testing.T) {
t.Parallel()
v := ctx.Value(tc.key)
@@ -74,7 +73,6 @@ func TestWithTrace(t *testing.T) {
expected: parentID,
})
for _, tc := range tests {
tc := tc
t.Run(tc.key, func(t *testing.T) {
t.Parallel()
v := ctx.Value(tc.key)

View File

@@ -40,7 +40,6 @@ func TestErrorCodes(t *testing.T) {
}
for ec := range errorCodeToDescriptors {
ec := ec
t.Run(ec.String(), func(t *testing.T) {
t.Parallel()
desc := errorCodeToDescriptors[ec]

View File

@@ -254,7 +254,6 @@ func checkTestRouter(t *testing.T, tests []routeTestCase, prefix string, deeplyE
server := httptest.NewServer(router)
for _, tc := range tests {
tc := tc
requestURI := strings.TrimSuffix(prefix, "/") + tc.RequestURI
t.Run("("+tc.RouteName+")"+requestURI, func(t *testing.T) {
t.Parallel()

View File

@@ -27,7 +27,6 @@ func TestAudienceList_Unmarshal(t *testing.T) {
}
for _, tc := range tests {
tc := tc
t.Run("", func(t *testing.T) {
t.Parallel()
var actual AudienceList

View File

@@ -491,7 +491,6 @@ func (imh *manifestHandler) DeleteManifest(w http.ResponseWriter, r *http.Reques
g := errgroup.Group{}
g.SetLimit(storage.DefaultConcurrencyLimit)
for _, tag := range referencedTags {
tag := tag
g.Go(func() error {
if err := tagService.Untag(imh, tag); err != nil {

View File

@@ -63,7 +63,6 @@ func TestErrors(t *testing.T) {
}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
if got := tc.errs.Error(); got != tc.exp {

View File

@@ -311,7 +311,6 @@ func TestEligibleForS3(t *testing.T) {
}
for _, tc := range tests {
tc := tc
t.Run(fmt.Sprintf("Client IP = %v", tc.RemoteAddr), func(t *testing.T) {
t.Parallel()
req := &http.Request{RemoteAddr: tc.RemoteAddr}
@@ -340,7 +339,6 @@ func TestEligibleForS3WithAWSIPNotInitialized(t *testing.T) {
}
for _, tc := range tests {
tc := tc
t.Run(fmt.Sprintf("Client IP = %v", tc.RemoteAddr), func(t *testing.T) {
t.Parallel()
req := &http.Request{RemoteAddr: tc.RemoteAddr}