From 60ae6e00f52416ef0f7217cae61a34e479e21c10 Mon Sep 17 00:00:00 2001 From: Tevin Zhang Date: Mon, 30 May 2022 21:42:03 +0800 Subject: [PATCH] Add doc for Toggle --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 105a787..1d00a35 100644 --- a/README.md +++ b/README.md @@ -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