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

View file

@ -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>