diff options
author | Michael Muré <batolettre@gmail.com> | 2022-12-21 21:54:36 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2022-12-21 21:54:36 +0100 |
commit | 9b98fc06489353053564b431ac0c0d73a5c55a56 (patch) | |
tree | 67cab95c0c6167c0982516a2dda610bd5ece9eab /cache/bug_excerpt.go | |
parent | 905c9a90f134842b97e2cf729d8b11ff59bfd766 (diff) | |
download | git-bug-9b98fc06489353053564b431ac0c0d73a5c55a56.tar.gz |
cache: tie up the refactor up to compiling
Diffstat (limited to 'cache/bug_excerpt.go')
-rw-r--r-- | cache/bug_excerpt.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cache/bug_excerpt.go b/cache/bug_excerpt.go index b4748fd2..26b7ec74 100644 --- a/cache/bug_excerpt.go +++ b/cache/bug_excerpt.go @@ -15,6 +15,8 @@ func init() { gob.Register(BugExcerpt{}) } +var _ Excerpt = &BugExcerpt{} + // BugExcerpt hold a subset of the bug values to be able to sort and filter bugs // efficiently without having to read and compile each raw bugs. type BugExcerpt struct { @@ -36,7 +38,8 @@ type BugExcerpt struct { CreateMetadata map[string]string } -func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt { +func NewBugExcerpt(b *BugCache) *BugExcerpt { + snap := b.Snapshot() participantsIds := make([]entity.Id, 0, len(snap.Participants)) for _, participant := range snap.Participants { participantsIds = append(participantsIds, participant.Id()) @@ -66,6 +69,10 @@ func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt { return e } +func (b *BugExcerpt) setId(id entity.Id) { + b.id = id +} + func (b *BugExcerpt) Id() entity.Id { return b.id } |