|
|
|
|
|
by zadwang
1345 days ago
|
|
If I understand correctly the fix requires the new code to add a line in go.mod to use the new behavior. This is about the same as adding x:=x in the loop, and more hidden. Not good. The alternative can be that whenever address of iteration variable is used inside the loop the variable is per iteration and otherwise it is per loop. This way it is not breaking the old code and have new semantics. |
|
That wouldn't fix the closure problem where the address isn't taken.