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>
This commit is contained in:
gojkovicmatija99
2026-03-09 22:52:34 +01:00
committed by Gopher Robot
parent c29bec8a3a
commit 8da2be3cd0
2 changed files with 0 additions and 2 deletions

View File

@@ -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() {

View File

@@ -184,7 +184,6 @@ func main() {
}
var wg sync.WaitGroup
for _, task := range tasks {
task := task
wg.Add(1)
go func() {
task()