5 ms·
The author didn't say it is a bug. The author just says this is a shortcoming of Go.
by tapirl 3y ago
The author didn't say it is a bug. The author just says this is a shortcoming of Go.
- coder543 3y ago> The author didn't say it is a bug. The author's title literally refers to it as a bug.
- Joker_vD 3y agoFor reasons it’s never really bothered me, but the *other* loop bug does bite me some times. This is the one where the loop values are values. The common mistakes wiki lists the capture bug twice, but doesn’t mention this bug. Yeah, I guess you're right, the author didn't call it a bug...
- tapirl 3y agoI believe the author doesn't mean it is a bug in the general sense. The author just means it is a shortcoming, and this shortcoming is surely fixable. The author provides a solution, but I think the zig way is better: for _, *player := range players { player.score = 0 }
- lsaferite 3y agoIf they meant 'shortcoming', they would have used that word. They used the word 'bug' to describe the issue. Repeatedly.