Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gigatexal
on June 11, 2022
|
parent
|
context
|
favorite
| on:
Data Race Patterns in Go
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?
yencabulator
on June 11, 2022
[–]
Yes.
for i := 0; i < 10; i++ { i := i ... }
https://go.dev/play/p/P7TunJCL7RS
gigatexal
on June 11, 2022
|
parent
[–]
Thank you!
The example is brilliant. Thanks.
Consider applying for YC's Spring batch! Applications are open till Feb 11.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: