How Go 1.22 fixed an issue that caused Google problems

Опубликовано: 11 Май 2026
на канале: Flo Woelki
5,761
157

Go 1.21 caused some weird loop issues, but luckily this has been fixed in the latest version of Golang. Understanding this problem is a must to deepen your knowledge about Golang. If you also want to fully understand Structs, I highly recommend watching this video:    • This is your last video about Golang Structs!  


📝 Description
In this video, we delve into the intricacies of writing better loops in Go 1.22. We take a deep dive into the behaviour of closures, the capture of variables in a loop, and the scope of loop variables. Drawing parallels with previous issues encountered by Let's Encrypt and Google, we examine how Go 1.22 has improved loop behaviour and addressed these concerns.


⏳ Timestamps:
00:00 - Introduction
00:35 - Exploration of the wrong Go code
03:37 - Running the Go 1.21 code
03:57 - What's the Issue?
05:35 - Fixing the Go 1.21 issue
06:37 - Go 1.22
07:25 - Outro


👋 Hey there!
If you are new to this channel: Hey 👋 my name is Flo and I am a professional software engineer with a passion for coding in Golang, TypeScript, JavaScript, and Rust. This channel is where I share that passion and dive into the exciting world of software engineering. Plus, I love using Emojis and paper-based animations (so have a look for that, if you want to find my videos).


📨 Support and Connect!
Become a member.    / @flowoelki  
Discord:   / discord  
X / Twitter: https://x.com/FlorianWoelki
LinkedIn:   / florian-woelki  
GitHub: https://github.com/FlorianWoelki


📝 Copyright Notice
The original Go Gopher was designed by Renée French (Source: https://go.dev/blog/gopher License details: https://creativecommons.org/licenses/.... The gopher appearing in this video and thumbnail is modified from the original design.


#golang #go #loops