mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
Updated CommonMistakes (markdown)
parent
2b744ad767
commit
f3e1944cb6
@ -57,7 +57,7 @@ for i := 1; i <= 10; i++ {
|
|||||||
Even though the closures all still close over the same variable (in this case, ` i `), they are executed before the variable changes, resulting in the desired behavior.
|
Even though the closures all still close over the same variable (in this case, ` i `), they are executed before the variable changes, resulting in the desired behavior.
|
||||||
http://golang.org/doc/go_faq.html#closures_and_goroutines
|
http://golang.org/doc/go_faq.html#closures_and_goroutines
|
||||||
|
|
||||||
Another similar situation that you may find like following:
|
You may find another, similar situation like the following:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
for _, val := range values {
|
for _, val := range values {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user