aboutsummaryrefslogtreecommitdiffstats
path: root/cache/bug_excerpt.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-23 21:24:57 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-23 21:24:57 +0200
commit0514edad1a6ee06902841e0c903fc2a2119b7e95 (patch)
tree104279a8939034ab163cac9bfc124166d001dda7 /cache/bug_excerpt.go
parente7648996c8f278d061fe03a5c4d255049da765e5 (diff)
downloadgit-bug-0514edad1a6ee06902841e0c903fc2a2119b7e95.tar.gz
cache: maintain, write and load from disk bug excerpts
Diffstat (limited to 'cache/bug_excerpt.go')
-rw-r--r--cache/bug_excerpt.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/cache/bug_excerpt.go b/cache/bug_excerpt.go
index 23ac459b..572f461a 100644
--- a/cache/bug_excerpt.go
+++ b/cache/bug_excerpt.go
@@ -1,6 +1,8 @@
package cache
import (
+ "encoding/gob"
+
"github.com/MichaelMure/git-bug/bug"
"github.com/MichaelMure/git-bug/util"
)
@@ -19,7 +21,7 @@ type BugExcerpt struct {
Author bug.Person
}
-func NewBugExcerpt(b *bug.Bug, snap bug.Snapshot) BugExcerpt {
+func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) BugExcerpt {
return BugExcerpt{
Id: b.Id(),
CreateLamportTime: b.CreateLamportTime(),
@@ -31,6 +33,11 @@ func NewBugExcerpt(b *bug.Bug, snap bug.Snapshot) BugExcerpt {
}
}
+// Package initialisation used to register the type for (de)serialization
+func init() {
+ gob.Register(BugExcerpt{})
+}
+
/*
* Sorting
*/