sync/atomic: describe return value of atomic.Bool CompareAndSwap #66095
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
Documentation
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Proposal Details
This is the current documentation for
atomic.Bool
CompareAndSwap
:This only happens for the special case
Bool
: From reading only the typesbool * bool -> bool
it is not clear if the return value is the first or second parameter, or some other bool value. The documentation comment just states the obvious (CompareAndSwap does compare-and-swap) andswapped
is ambiguous IMHO b/c it could mean the swapped-in value new, the swapped-out value old, or that the swap operation was done.The proposal is to clarify the doc comment as e.g. (assuming this is even correct)
I'm not native English speaking, so, there is probably better wording.
References
The text was updated successfully, but these errors were encountered: