]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.17] sync/atomic: fix documentation for CompareAndSwap
authorJeff Wentworth <j.wentworth@gmail.com>
Sat, 14 Aug 2021 09:46:32 +0000 (09:46 +0000)
committerDmitri Shuralyov <dmitshur@golang.org>
Sun, 15 Aug 2021 22:50:19 +0000 (22:50 +0000)
The documentation for CompareAndSwap atomic/value incorrectly labelled
the function as CompareAndSwapPointer. This PR fixes that.

Updates #47699.
Fixes #47703.

Change-Id: I6db08fdfe166570b775248fd24550f5d28e3434e
GitHub-Last-Rev: 41f78707928f48c9cdac26b6a4f618d4284e1ca1
GitHub-Pull-Request: golang/go#47700
Reviewed-on: https://go-review.googlesource.com/c/go/+/342210
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Trust: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Go Bot <gobot@golang.org>
(cherry picked from commit 0a0a160d4df488939892a1adaca6c530fb784cc8)
Reviewed-on: https://go-review.googlesource.com/c/go/+/342329
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/sync/atomic/value.go

index 61f81d8fd377b06e49e49b70bf88918589766998..3500cd22f4e74e7991d4f9cfca1ea6856695b722 100644 (file)
@@ -126,7 +126,7 @@ func (v *Value) Swap(new interface{}) (old interface{}) {
        }
 }
 
-// CompareAndSwapPointer executes the compare-and-swap operation for the Value.
+// CompareAndSwap executes the compare-and-swap operation for the Value.
 //
 // All calls to CompareAndSwap for a given Value must use values of the same
 // concrete type. CompareAndSwap of an inconsistent type panics, as does