diff options
| author | gojkovicmatija99 <gojkovicmatija99@gmail.com> | 2026-03-09 22:52:34 +0100 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-03-10 15:12:10 -0700 |
| commit | 8da2be3cd01a27830f7b2209f30850b1e1c83f00 (patch) | |
| tree | 9bfbf24bcfd5d0cae4cbfa23371bd9e9176bf336 /src/cmd/compile | |
| parent | c29bec8a3acc2a5464fc3aa04cb03dc2408a2030 (diff) | |
| download | go-8da2be3cd01a27830f7b2209f30850b1e1c83f00.tar.xz | |
cmd/compile: remove loop variable capture workarounds
Since Go 1.22, loop variables have per-iteration scope, making
the x := x this pattern unnecessary for goroutine capture.
No issue required for this trivial cleanup.
Change-Id: I00d98522537fc2b9a6b4d598c8aa21b447628d41
Reviewed-on: https://go-review.googlesource.com/c/go/+/753400
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Diffstat (limited to 'src/cmd/compile')
| -rw-r--r-- | src/cmd/compile/internal/noder/noder.go | 1 | ||||
| -rw-r--r-- | src/cmd/compile/internal/ssa/_gen/main.go | 1 |
2 files changed, 0 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/noder/noder.go b/src/cmd/compile/internal/noder/noder.go index 79a9078333..973d917784 100644 --- a/src/cmd/compile/internal/noder/noder.go +++ b/src/cmd/compile/internal/noder/noder.go @@ -41,7 +41,6 @@ func LoadPackage(filenames []string) { // Move the entire syntax processing logic into a separate goroutine to avoid blocking on the "sem". go func() { for i, filename := range filenames { - filename := filename p := noders[i] sem <- struct{}{} go func() { diff --git a/src/cmd/compile/internal/ssa/_gen/main.go b/src/cmd/compile/internal/ssa/_gen/main.go index a26a4a4ea8..610944660f 100644 --- a/src/cmd/compile/internal/ssa/_gen/main.go +++ b/src/cmd/compile/internal/ssa/_gen/main.go @@ -184,7 +184,6 @@ func main() { } var wg sync.WaitGroup for _, task := range tasks { - task := task wg.Add(1) go func() { task() |
