Go 1.22 was released yesterday, and it finally included the feature that I always wanted it to have ⚡
It always felt weird to write the regular for loops in go to iterate over integers, given how frequently we use “range”. With the 1.22 version of Go, the “For” loops may now range over integers making it uniform to scan across integers, lists, and maps.
By the way, I did something very similar for Python, about 3 years back by altering the CPython source code and making integers iterable, and wrote a detailed blog post about it.
Give it a read - https://lnkd.in/giB-rWz
Looks like I was slightly ahead of the time 😅
⚡ I keep writing and sharing these engineering nuggets, so if you are keen on learning them, follow along.