From 833f8b94c2cd88277eba32984594aad2b7b2b05d Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Tue, 24 Jan 2017 21:43:02 -0500 Subject: Search bar for issues/pulls (#530) --- modules/util/util.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 modules/util/util.go (limited to 'modules/util/util.go') diff --git a/modules/util/util.go b/modules/util/util.go new file mode 100644 index 0000000000..4859965388 --- /dev/null +++ b/modules/util/util.go @@ -0,0 +1,25 @@ +// Copyright 2017 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package util + +// OptionalBool a boolean that can be "null" +type OptionalBool byte + +const ( + // OptionalBoolNone a "null" boolean value + OptionalBoolNone = iota + // OptionalBoolTrue a "true" boolean value + OptionalBoolTrue + // OptionalBoolFalse a "false" boolean value + OptionalBoolFalse +) + +// OptionalBoolOf get the corresponding OptionalBool of a bool +func OptionalBoolOf(b bool) OptionalBool { + if b { + return OptionalBoolTrue + } + return OptionalBoolFalse +} -- cgit v1.2.3