summaryrefslogtreecommitdiff
path: root/lib.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib.go')
-rw-r--r--lib.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib.go b/lib.go
index b28b50f..2f3df35 100644
--- a/lib.go
+++ b/lib.go
@@ -121,3 +121,14 @@ func deepCopy(dst, src interface{}) error {
}
return gob.NewDecoder(bytes.NewBuffer(buf.Bytes())).Decode(dst)
}
+
+// boolPtr returns a pointer to a bool with the given value.
+func boolPtr(b bool) *bool { return &b }
+
+// defaultTrue returns true if b is nil, or the pointed value.
+func defaultTrue(b *bool) bool {
+ if b == nil {
+ return true
+ }
+ return *b
+}