The correct way of addressing the issue is not to redeclare the variable, but to use func(v string) instead of func(). func() uses a pointer implicitly, whereas func(v string) copies the value. If we use func(), the value might be modified by some other part of the program.
awesome stuff! generally, I use Zed at the moment as my main editor. so, I was switching from nvim to Zed. but the editor theme is the official GitHub theme.
The correct way of addressing the issue is not to redeclare the variable, but to use func(v string) instead of func().
func() uses a pointer implicitly, whereas func(v string) copies the value.
If we use func(), the value might be modified by some other part of the program.
What is that extension, that let you see the type of variable in a loop.
thanks , i recently go into go again after some years had no idea this was fix , btw whats you editor config
awesome stuff!
generally, I use Zed at the moment as my main editor. so, I was switching from nvim to Zed. but the editor theme is the official GitHub theme.
@@FloWoelki thank you 👍🏽
can you please create a video on you developer workflow? Editor config etc
Sure, it's in the pipeline :)
@@FloWoelki awesome. Recently found your channel, already loving the content. ❤️
@@ayushtripathi4514 Much appreciated, thank you! :)
Isn't this a huge breaking change for existing software?
Not really, because the original code itself did not really change. The only change was in the Go compiler itself.
Thanks.
You're welcome :)