create the Snapshot type for a compiled bug operation log

Michael Muré created

Change summary

bug/bug.go      | 13 ++++++++++++-
bug/label.go    |  3 +++
commands/new.go |  2 +-
3 files changed, 16 insertions(+), 2 deletions(-)

Detailed changes

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
+//}

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},
 	}