Commit cbea7243 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder Committed by Rob Pike

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
parent aff7ea94
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment