Go 1.22 was released yesterday, and it finally included the

Arpit Bhayani

Arpit Bhayani

Feb 08, 2024 • 1 min read


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.

Arpit Bhayani

Principal Engineer II at Razorpay - building Agent Studio, Ex-staff engg at GCP Memorystore & Dataproc, Creator of DiceDB, ex-Amazon Fast Data, ex-Director of Engg. SRE and Data Engineering at Unacademy. I spark engineering curiosity through my no-fluff engineering videos on YouTube and my courses