mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
faq: mention go vet in "What happens with closures running as goroutines?"
R=r CC=golang-dev https://golang.org/cl/6822111
This commit is contained in:
parent
20a1815833
commit
89ed40c44b
1 changed files with 2 additions and 0 deletions
|
@ -1262,6 +1262,8 @@ each iteration of the loop uses the same instance of the variable <code>v</code>
|
|||
each closure shares that single variable. When the closure runs, it prints the
|
||||
value of <code>v</code> at the time <code>fmt.Println</code> is executed,
|
||||
but <code>v</code> may have been modified since the goroutine was launched.
|
||||
To help detect this and other problems before they happen, run
|
||||
<a href="http://golang.org/cmd/go/#Run_go_tool_vet_on_packages"><code>go vet</code></a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
Loading…
Reference in a new issue