diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-18 00:16:06 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-18 00:16:06 +0200 |
commit | ba3281dc9918fa49f10c2a166b5b631a931d2d51 (patch) | |
tree | f6e9d17fa7828634f250c7af0674d5405ba0d224 /bug/snapshot.go | |
parent | 6f83d89274fc796e01149c84b91b8aa2066f0273 (diff) | |
download | git-bug-ba3281dc9918fa49f10c2a166b5b631a931d2d51.tar.gz git-bug-ba3281dc9918fa49f10c2a166b5b631a931d2d51.zip |
all operations now have an author and a timestamp
Diffstat (limited to 'bug/snapshot.go')
-rw-r--r-- | bug/snapshot.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bug/snapshot.go b/bug/snapshot.go index 9229e7a1..75d3a028 100644 --- a/bug/snapshot.go +++ b/bug/snapshot.go @@ -7,11 +7,14 @@ import ( // Snapshot is a compiled form of the Bug data structure used for storage and merge type Snapshot struct { - id string + id string + Status Status Title string Comments []Comment Labels []Label + + Operations []Operation } // Return the Bug identifier @@ -32,10 +35,11 @@ func (snap Snapshot) Summary() string { ) } +// Return the last time a bug was modified func (snap Snapshot) LastEdit() time.Time { - if len(snap.Comments) == 0 { + if len(snap.Operations) == 0 { return time.Unix(0, 0) } - lastEditTimestamp := snap.Comments[len(snap.Comments)-1].Time - return time.Unix(lastEditTimestamp, 0) + + return snap.Operations[len(snap.Operations)-1].Time() } |