aboutsummaryrefslogtreecommitdiffstats
path: root/bug/snapshot.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-17 19:28:37 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-17 19:28:37 +0200
commit76ac1787b8de8698b878d1837c5fa8f6fe6403fc (patch)
tree2261d605eb533bc5f037887a983da0039281c9f5 /bug/snapshot.go
parent7b19b10e19e5dbbae79a47d3e4338b15b3e8d972 (diff)
downloadgit-bug-76ac1787b8de8698b878d1837c5fa8f6fe6403fc.tar.gz
add bug status + open/close commands
Diffstat (limited to 'bug/snapshot.go')
-rw-r--r--bug/snapshot.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/bug/snapshot.go b/bug/snapshot.go
index 9b9acf87..53a010bb 100644
--- a/bug/snapshot.go
+++ b/bug/snapshot.go
@@ -7,11 +7,23 @@ import (
// Snapshot is a compiled form of the Bug data structure used for storage and merge
type Snapshot struct {
+ id string
+ Status Status
Title string
Comments []Comment
Labels []Label
}
+// Return the Bug identifier
+func (snap Snapshot) Id() string {
+ return snap.id
+}
+
+// Return the Bug identifier truncated for human consumption
+func (snap Snapshot) HumanId() string {
+ return fmt.Sprintf("%.8s", snap.id)
+}
+
func (snap Snapshot) Summary() string {
return fmt.Sprintf("c:%d l:%d %s",
len(snap.Comments)-1,