Y
Hacker News
new
|
ask
|
show
|
jobs
by
gigatexal
1469 days ago
In the closure example does declaring a new variable and setting its value to the iterative or the thing being passed in, does that mitigate the pass by reference issue?
1 comments
yencabulator
1468 days ago
Yes.
for i := 0; i < 10; i++ { i := i ... }
https://go.dev/play/p/P7TunJCL7RS
link
gigatexal
1468 days ago
Thank you!
The example is brilliant. Thanks.
link