Skip to content

Commit

Permalink
replace deprecated function CAS in examples (#138)
Browse files Browse the repository at this point in the history
Update example_test.go and README.md replacing deprecated func
  • Loading branch information
gabrielcipriano authored Jul 14, 2023
1 parent 8af810e commit b1c4565
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b1c4565

Please sign in to comment.