Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
chen_dev
on Sept 19, 2023
|
parent
|
context
|
favorite
| on:
Fixing for loops in Go 1.22
the 'fix' to the example in the README should be obvious, but for reference:
- for _, e := range es {
- pumpUp(&e)
}
+ for i := range es {
+ pumpUp(&es[i])
}
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
- for _, e := range es {
- pumpUp(&e)
}
+ for i := range es {
+ pumpUp(&es[i])
}