mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: remove unnecessary redeclarations in for loops (#18440)
This commit is contained in:
@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user