From 3aecdf2c2da9017513ca04a183089099fb3677d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Thu, 12 Jul 2018 21:31:11 +0200 Subject: [PATCH] create the Snapshot type for a compiled bug operation log --- bug/bug.go | 13 ++++++++++++- bug/label.go | 3 +++ commands/new.go | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 bug/label.go diff --git a/bug/bug.go b/bug/bug.go index 33da13262487be6861fed1cd4df72d868f4c1d6e..ac99c164780bcdb6eed5698f57ea941e088106d0 100644 --- a/bug/bug.go +++ b/bug/bug.go @@ -1,7 +1,18 @@ package bug -type Bug struct { +// Snapshot is a compiled form of the Bug data structure used for storage and merge +type Snapshot struct { Title string Comments []Comment + Labels []Label } +//func (bug Bug) Check() error { +// if bug.Operations.Len() == 0 { +// return "Empty operation log" +// } +// +// if bug.Operations.Elems() +// +// return true +//} diff --git a/bug/label.go b/bug/label.go new file mode 100644 index 0000000000000000000000000000000000000000..c202cd70a13adae12666ac0e467adda12efdea5f --- /dev/null +++ b/bug/label.go @@ -0,0 +1,3 @@ +package bug + +type Label string diff --git a/commands/new.go b/commands/new.go index 43bfd2120a9e06c6b4ac0eb769f7d942111c95e8..6dd19508301616eabb5371d3436a749be92f7040 100644 --- a/commands/new.go +++ b/commands/new.go @@ -55,7 +55,7 @@ func newBug(repo repository.Repo, args []string) error { Message: *newMessage, } - bug := bug.Bug{ + bug := bug.Snapshot{ Title: title, Comments: []bug.Comment{comment}, }