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

If you never did a mistake connected to this and caused a bug in real prod code, you haven’t been writing go for long enough.


Ehhhh, I’ve been writing Go for ~10 years and I’ve never had this make it into prod. Many times in local development and testing, though.


Or you've been using the looppointer analyser[1] from the start, heh.

[1]: https://github.com/kyoh86/looppointer


Ideally at least one of the tests out of your testing pyramid would catch something like that though.


Ideally yeah, but unfortunately very few people work in ideal circumstances.


Yeahhhhh, I worked at a big company on their CI product and I had this bug bite me and break builds for a little bit.

Luckily caught my mistake and fixed it within 15 minutes, but it's always easy to overlook.


I internalized early on that the likelihood of this mistake means Go wants me to refactor when I find myself liable to making it.




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

Search: