diff options
author | Ian Lance Taylor <iant@golang.org> | 2018-12-21 11:16:43 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2018-12-21 21:46:38 +0000 |
commit | e7c20b7917989e678a2800378b807fe0fdaf8031 (patch) | |
tree | a06b5775005ec3c50018fb95fd17c55b087e3aed /doc/go_mem.html | |
parent | b7451e299ba2b1f69ecf8744adaf028ae437f262 (diff) | |
download | go-git-e7c20b7917989e678a2800378b807fe0fdaf8031.tar.gz |
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>
Diffstat (limited to 'doc/go_mem.html')
-rw-r--r-- | doc/go_mem.html | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/go_mem.html b/doc/go_mem.html index 143f3b2ff2..d355bebaed 100644 --- a/doc/go_mem.html +++ b/doc/go_mem.html @@ -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> |