diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-15 13:15:00 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-15 13:15:00 +0200 |
commit | 7bec0b1f134d213e7505fc2ac03ffea26f2193cc (patch) | |
tree | e263cccd84406843eacbc6bd184acdacb25a49d1 /bug/status.go | |
parent | b478cd1bcb4756b20f7f4b15fcf81f23e1a60a02 (diff) | |
download | git-bug-7bec0b1f134d213e7505fc2ac03ffea26f2193cc.tar.gz |
bug: add a data validation process to avoid merging incorrect operations
Diffstat (limited to 'bug/status.go')
-rw-r--r-- | bug/status.go | 8 |
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 +} |