summaryrefslogtreecommitdiffstats
path: root/modules/util/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/util/util.go')
-rw-r--r--modules/util/util.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/util/util.go b/modules/util/util.go
index 4859965388..104c80f524 100644
--- a/modules/util/util.go
+++ b/modules/util/util.go
@@ -16,6 +16,21 @@ const (
OptionalBoolFalse
)
+// IsTrue return true if equal to OptionalBoolTrue
+func (o OptionalBool) IsTrue() bool {
+ return o == OptionalBoolTrue
+}
+
+// IsFalse return true if equal to OptionalBoolFalse
+func (o OptionalBool) IsFalse() bool {
+ return o == OptionalBoolFalse
+}
+
+// IsNone return true if equal to OptionalBoolNone
+func (o OptionalBool) IsNone() bool {
+ return o == OptionalBoolNone
+}
+
// OptionalBoolOf get the corresponding OptionalBool of a bool
func OptionalBoolOf(b bool) OptionalBool {
if b {