Skip to content

Commit

Permalink
Remove unnecessary loop variable capture (as of Go v1.22).
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Mar 2, 2024
1 parent d5116c9 commit 24feede
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func (e *Engine) Run(ctx context.Context) error {
})

for _, task := range e.config.Tasks {
task := task // capture loop variable
g.Go(func() error {
return task(ctx)
})
Expand Down
2 changes: 0 additions & 2 deletions internal/eventstream/append_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ func TestAppend(t *testing.T) {
}

for _, c := range cases {
c := c // capture loop variable

t.Run(c.Desc, func(t *testing.T) {
tctx := test.WithContext(t)
deps := setup(tctx)
Expand Down

0 comments on commit 24feede

Please sign in to comment.