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:
Ian Lance Taylor 2018-12-21 11:16:43 -08:00
parent b7451e299b
commit e7c20b7917
1 changed files with 6 additions and 2 deletions

View File

@ -418,8 +418,12 @@ func twoprint() {
</pre> </pre>
<p> <p>
calling <code>twoprint</code> causes <code>"hello, world"</code> to be printed twice. calling <code>twoprint</code> will call <code>setup</code> exactly
The first call to <code>doprint</code> runs <code>setup</code> once. 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> </p>
<h2>Incorrect synchronization</h2> <h2>Incorrect synchronization</h2>