mirror of
https://github.com/golang/go
synced 2024-11-21 21:14:47 -07:00
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
This commit is contained in:
parent
aff7ea9458
commit
cbea724378
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user