Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
tyho
22 days ago
|
parent
|
context
|
favorite
| on:
The Story Behind “100 Go Mistakes and How to Avoid...
The single example given here is incorrect. Since Go 1.22 loop variables have per-iteration scope, the "broken" code is deterministic and correct.
https://go.dev/blog/loopvar-preview
teivah
22 days ago
|
next
[–]
Outdated I'd rather say :) I documented here
https://100go.co/#not-being-careful-with-goroutines-and-loop...
but you're right, it was fixed (alongside 2 other mistakes in the 100).
yndoendo
22 days ago
|
parent
|
next
[–]
I still need to support Windows 7 in my industry. The last supported version is 1.20. Outdated is relative.
tyho
22 days ago
|
parent
|
prev
|
next
[–]
I wrote some code today and I relied on the new behaviour. I felt a little dirty.
josefx
21 days ago
|
prev
[–]
That was an issue in 2023? Quite sure C# fixed something similar back in 2012. Is Go still proudly reinventing the wheel, wooden and filled with termites?
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
https://go.dev/blog/loopvar-preview