mirror of
https://github.com/golang/go
synced 2024-10-06 08:00:07 +00:00
doc: go_mem: clarify Once docs
Fixes #27808 Change-Id: Ia643d51004c47953642a2ba41dfed281f1112be6 Reviewed-on: https://go-review.googlesource.com/c/155637 Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
parent
b7451e299b
commit
e7c20b7917
|
@ -418,8 +418,12 @@ func twoprint() {
|
|||
</pre>
|
||||
|
||||
<p>
|
||||
calling <code>twoprint</code> causes <code>"hello, world"</code> to be printed twice.
|
||||
The first call to <code>doprint</code> runs <code>setup</code> once.
|
||||
calling <code>twoprint</code> will call <code>setup</code> exactly
|
||||
once.
|
||||
The <code>setup</code> function will complete before either call
|
||||
of <code>print</code>.
|
||||
The result will be that <code>"hello, world"</code> will be printed
|
||||
twice.
|
||||
</p>
|
||||
|
||||
<h2>Incorrect synchronization</h2>
|
||||
|
|
Loading…
Reference in a new issue