aboutsummaryrefslogtreecommitdiffstats
path: root/bug/status.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/status.go')
-rw-r--r--bug/status.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/bug/status.go b/bug/status.go
index f15924e2..737c8d31 100644
--- a/bug/status.go
+++ b/bug/status.go
@@ -47,3 +47,11 @@ func StatusFromString(str string) (Status, error) {
return 0, fmt.Errorf("unknow status")
}
}
+
+func (s Status) Validate() error {
+ if s != OpenStatus && s != ClosedStatus {
+ return fmt.Errorf("invalid")
+ }
+
+ return nil
+}