Re:Go: Redefining For Loop Variable Semantics
by ok_dad on Tuesday October 11, 2022 @02:46PM
(#33167420)
I'm glad I read this today because I'm starting to do some work in Go. Anyone have any other good sources for "gotchas" in Go (Go-tchas?) that I can read to familiarize myself with how to think better in Go?
[ Parent
| on HN ]
Re:Go: Redefining For Loop Variable Semantics
by bts on Tuesday October 11, 2022 @03:34PM
(#33168163)
Data Race Patterns in Go: https://eng.uber.com/data-race-patterns-in-go/
Re:Go: Redefining For Loop Variable Semantics
by ok_dad on Tuesday October 11, 2022 @06:34PM
(#33170127)
Thanks, that article seems to me like a primer for "Why Go should have a block scoping option" because practically every error introduced there seems to be part of a scoping issue. I love the block scoping of a Lua `local` when I use Lua, and I wish I could do that in Go!