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:
https://youtu.be/c8H0w4yBL10
📝 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!
Buy me a coffee: https://www.buymeacoffee.com/florianwoelki
Become a member: https://www.youtube.com/@FloWoelki/membership
Discord: https://discord.gg/TnA7drJ
Instagram: https://www.instagram.com/flowydev/
LinkedIn: https://www.linkedin.com/in/florian-woelki/
TikTok: https://www.tiktok.com/@florianwoelki
GitHub: https://github.com/FlorianWoelki
📝 Copyright Notice
The original Go Gopher version is originally designed by Renée French (Source: https://go.dev/blog/gopher License details: https://creativecommons.org/licenses/by/4.0/). The gopher used in the video and thumbnail is inspired by this author.
#golang #go #loops