From: Josh Bleecher Snyder Date: Wed, 28 Aug 2013 02:53:59 +0000 (+1000) Subject: sync: improve once.Do documentation readability X-Git-Tag: go1.2rc2~409 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=cbea724378e1586cd92f1fffddcad61af893ba1d;p=gostls13.git sync: improve once.Do documentation readability The previous wording, though accurate, was hard to parse. In particular, it was tempting to interpret "the method" as referring to "the function f" instead of "Do", and required effort to find the correct antecedent for "this receiver". R=golang-dev, bradfitz, r CC=golang-dev https://golang.org/cl/13307043 --- diff --git a/src/pkg/sync/once.go b/src/pkg/sync/once.go index 1699e86a9e..161ae3b3e9 100644 --- a/src/pkg/sync/once.go +++ b/src/pkg/sync/once.go @@ -14,8 +14,8 @@ type Once struct { done uint32 } -// Do calls the function f if and only if the method is being called for the -// first time with this receiver. In other words, given +// Do calls the function f if and only if Do is being called for the +// first time for this instance of Once. In other words, given // var once Once // if once.Do(f) is called multiple times, only the first call will invoke f, // even if f has a different value in each invocation. A new instance of