Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

i was surprised by it. objc gives you a new variable each time through the loop.

it's basically never what you want; if it were changed and you did sometimes want it, it would be easy to get

    var i int
    for blah blah blah...
oh well, the cure isn't bad:

    i := i


This is mentioned in the Effective Go document.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: