News for hackers. Stuff that matters.
Re:Fixing for Loops in Go 1.22 by freedomben on Tuesday September 19, 2023 @04:15PM (#37575882)
I upvoted the question to offset one of the downs because I agree it's a fair question. However I would guess the downvotes are because TFA addressed this issue directly and comprehensively, so it's a clear "I didn't read the article" indicator :-) Possibly also because the downvoters can't imagine a scenario where this would be desirable behavior (i.e. it's always a bug)
Re:Fixing for Loops in Go 1.22 by campbel on Tuesday September 19, 2023 @04:18PM (#37575928)
Yeah its fair, I didn't closely read that section. Although, I'm not entirely convinced the approach is safe, maybe its worth it to fix such a common pitfall.
Re:Fixing for Loops in Go 1.22 by colejohnson66 on Tuesday September 19, 2023 @04:43PM (#37576246)
But if it’s a bug, then the logic to not compile future versions is wrong, IMO. If it’s a feature change, then such logic would make sense.