Go fixed that error.
Fixing For Loops.
Go Version <=go1.21
for i := range whatever { defer func() { fmt.Print(i) }() }
Outputs: 44444
44444
Go Version >=go1.22
Outputs: 43210
43210