Skip to content

Commit

Permalink
delete go loop copy vars
Browse files Browse the repository at this point in the history
  • Loading branch information
danicc097 committed Jan 19, 2025
1 parent 5d14948 commit a5f2b14
Show file tree
Hide file tree
Showing 23 changed files with 1 addition and 38 deletions.
2 changes: 0 additions & 2 deletions bin/templates/crud-api-tests.go.tmpl.bash
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ $(test -n "$with_project" && echo " pj := models.ProjectNameDemo
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
ufixture := ff.CreateUser(context.Background(), servicetestutil.CreateUserParams{
Expand Down Expand Up @@ -217,7 +216,6 @@ done)
// },
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
Expand Down
3 changes: 0 additions & 3 deletions bin/templates/crud-repo-tests.go.tmpl.bash
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ $(test -n "$with_project" && echo " projectID := internal.ProjectIDByName[models
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -112,7 +111,6 @@ func Test${pascal_name}_${delete_method}(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -154,7 +152,6 @@ func Test${pascal_name}_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range uniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}
}
Expand Down
1 change: 0 additions & 1 deletion bin/templates/crud-service-tests.go.tmpl.bash
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ done)
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
Expand Down
2 changes: 0 additions & 2 deletions internal/codegen/codegen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func TestAnalyzeSpec(t *testing.T) {
}

for _, tc := range cases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -222,7 +221,6 @@ func (h *StrictHandlers) Bar() {
// },
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions internal/repos/postgresql/repo_activity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func TestActivity_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range uniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}

Expand All @@ -68,7 +67,6 @@ func TestActivity_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range nonUniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}
}
2 changes: 0 additions & 2 deletions internal/repos/postgresql/repo_kanban_step_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func TestKanbanStep_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range uniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}

Expand All @@ -50,7 +49,6 @@ func TestKanbanStep_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range nonUniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}
}
1 change: 0 additions & 1 deletion internal/repos/postgresql/repo_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func TestProject_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range uniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}
}
Expand Down
2 changes: 0 additions & 2 deletions internal/repos/postgresql/repo_team_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func TestTeam_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range uniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}
}
Expand Down Expand Up @@ -122,7 +121,6 @@ func TestTriggers_sync_user_teams(t *testing.T) {
},
}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/repos/postgresql/repo_time_entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func TestTimeEntry_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range uniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}

Expand Down
4 changes: 0 additions & 4 deletions internal/repos/postgresql/repo_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func TestUser_Update(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -109,7 +108,6 @@ func TestUser_SoftDelete(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -192,7 +190,6 @@ func TestUser_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range uniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}

Expand Down Expand Up @@ -227,7 +224,6 @@ func TestUser_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range nonUniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}
}
Expand Down
3 changes: 0 additions & 3 deletions internal/repos/postgresql/repo_work_item_comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func TestWorkItemComment_Update(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -101,7 +100,6 @@ func TestWorkItemComment_Delete(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -141,7 +139,6 @@ func TestWorkItemComment_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range uniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ func TestDemoWorkItem_Update(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func TestDemoTwoWorkItem_Update(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/repos/postgresql/repo_work_item_tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func TestWorkItemTag_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range uniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}
}
1 change: 0 additions & 1 deletion internal/repos/postgresql/repo_work_item_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func TestWorkItemType_ByIndexedQueries(t *testing.T) {
},
}
for _, tc := range uniqueTestCases {
tc := tc
runGenericFilterTests(t, tc)
}
}
2 changes: 0 additions & 2 deletions internal/rest/api_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func TestHandlers_DeleteUser(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
ufixture := ff.CreateUser(context.Background(), servicetestutil.CreateUserParams{
Expand Down Expand Up @@ -233,7 +232,6 @@ func TestHandlers_UpdateUser(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion internal/rest/api_work_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (h *StrictHandlers) CreateWorkitem(c *gin.Context, request CreateWorkitemRe

var resJson *CreateWorkitem201JSONResponse
json.Unmarshal(rawMessage(res), &resJson)
return *resJson, nil
return resJson, nil
}

func (h *StrictHandlers) GetWorkItem(c *gin.Context, request GetWorkItemRequestObject) (GetWorkItemResponseObject, error) {
Expand Down
2 changes: 0 additions & 2 deletions internal/rest/api_work_item_comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ func TestHandlers_DeleteWorkItemComment(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -205,7 +204,6 @@ func TestHandlers_UpdateWorkItemComment(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/rest/api_work_item_tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func TestHandlers_CreateWorkItemTag(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/rest/middleware.auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func TestAuthorizationMiddleware(t *testing.T) {
svcs := services.New(logger, services.CreateTestRepos(t), testPool)

for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
res := httptest.NewRecorder()
Expand Down
2 changes: 0 additions & 2 deletions internal/services/service_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ func TestUser_UpdateUser(t *testing.T) {
}

for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -286,7 +285,6 @@ func TestUser_UpdateUserAuthorization(t *testing.T) {
}

for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/services/service_work_item_comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func TestWorkItemComment_Update(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/services/service_work_item_tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ func TestWorkItemTag_Update(t *testing.T) {
}

for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit a5f2b14

Please sign in to comment.