replace deprecated function CAS in examples (#138)

Update example_test.go and README.md replacing deprecated func
This commit is contained in:
Gabriel Cipriano
2023-07-14 15:17:35 -03:00
committed by GitHub
parent 8af810e0b0
commit b1c4565f21
2 changed files with 2 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ provide a safer, more convenient API.
var atom atomic.Uint32
atom.Store(42)
atom.Sub(2)
atom.CAS(40, 11)
atom.CompareAndSwap(40, 11)
```
See the [documentation][doc] for a complete API specification.

View File

@@ -33,7 +33,7 @@ func Example() {
// The wrapper ensures that all operations are atomic.
atom.Store(42)
fmt.Println(atom.Inc())
fmt.Println(atom.CAS(43, 0))
fmt.Println(atom.CompareAndSwap(43, 0))
fmt.Println(atom.Load())
// Output: