chore: remove unnecessary redeclarations in for loops (#18440)

This commit is contained in:
ケイラ
2025-06-20 13:16:55 -06:00
committed by GitHub
parent 4fe0a4bca2
commit fae30a00fd
200 changed files with 0 additions and 431 deletions

View File

@ -550,8 +550,6 @@ func TestTemplateInsights_Golden(t *testing.T) {
// Prepare all the templates.
for _, template := range templates {
template := template
var parameters []*proto.RichParameter
for _, parameter := range template.parameters {
var options []*proto.RichParameterOption
@ -582,10 +580,7 @@ func TestTemplateInsights_Golden(t *testing.T) {
)
var resources []*proto.Resource
for _, user := range users {
user := user
for _, workspace := range user.workspaces {
workspace := workspace
if workspace.template != template {
continue
}
@ -1246,7 +1241,6 @@ func TestTemplateInsights_Golden(t *testing.T) {
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
@ -1261,7 +1255,6 @@ func TestTemplateInsights_Golden(t *testing.T) {
_, _ = <-events, <-events
for _, req := range tt.requests {
req := req
t.Run(req.name, func(t *testing.T) {
t.Parallel()
@ -1489,8 +1482,6 @@ func TestUserActivityInsights_Golden(t *testing.T) {
// Prepare all the templates.
for _, template := range templates {
template := template
// Prepare all workspace resources (agents and apps).
var (
createWorkspaces []func(uuid.UUID)
@ -1498,10 +1489,7 @@ func TestUserActivityInsights_Golden(t *testing.T) {
)
var resources []*proto.Resource
for _, user := range users {
user := user
for _, workspace := range user.workspaces {
workspace := workspace
if workspace.template != template {
continue
}
@ -2031,7 +2019,6 @@ func TestUserActivityInsights_Golden(t *testing.T) {
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
@ -2046,7 +2033,6 @@ func TestUserActivityInsights_Golden(t *testing.T) {
_, _ = <-events, <-events
for _, req := range tt.requests {
req := req
t.Run(req.name, func(t *testing.T) {
t.Parallel()
@ -2159,8 +2145,6 @@ func TestTemplateInsights_RBAC(t *testing.T) {
}
for _, tt := range tests {
tt := tt
t.Run(fmt.Sprintf("with interval=%q", tt.interval), func(t *testing.T) {
t.Parallel()
@ -2279,9 +2263,6 @@ func TestGenericInsights_RBAC(t *testing.T) {
}
for endpointName, endpoint := range endpoints {
endpointName := endpointName
endpoint := endpoint
t.Run(fmt.Sprintf("With%sEndpoint", endpointName), func(t *testing.T) {
t.Parallel()
@ -2291,8 +2272,6 @@ func TestGenericInsights_RBAC(t *testing.T) {
}
for _, tt := range tests {
tt := tt
t.Run("AsOwner", func(t *testing.T) {
t.Parallel()