Add doc for Toggle

This commit is contained in:
Tevin Zhang 2022-05-30 21:42:03 +08:00
parent ef804a4993
commit 60ae6e00f5
No known key found for this signature in database
GPG Key ID: EE7DA2A50F0960FB
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ cond.UnSet() // Sets to false
cond.IsNotSet() // Returns true
cond.SetTo(any) // Sets to whatever you want
cond.SetToIf(old, new) // Sets to `new` only if the Boolean matches the `old`, returns whether succeeded
cond.Toggle() // Flip the value of `cond`, returns the value before flipping
// embedding
@ -59,4 +60,4 @@ BenchmarkAtomicBoolCAS-4 100000000 11.7 ns/op # <--- This package
- Implemented JSON Unmarshal and Marshal interface
- [Sebastian Schicho](https://github.com/schicho)
- Reported a regression with test case
- Reintroduced the `Toggle` method