diff options
author | Michael Muré <batolettre@gmail.com> | 2019-08-11 14:08:03 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-08-11 14:08:03 +0200 |
commit | 67a3752e176790e82a48706236f889cab4f8913d (patch) | |
tree | 113251396fc2569d1db2c2e6fcadb30289b3aa96 /bug/timeline.go | |
parent | a0dfc202117e31e01d2d6ec701a41292df35d35d (diff) | |
download | git-bug-67a3752e176790e82a48706236f889cab4f8913d.tar.gz |
bug,entity: use a dedicated type to store IDs
Diffstat (limited to 'bug/timeline.go')
-rw-r--r-- | bug/timeline.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bug/timeline.go b/bug/timeline.go index 247c2927..4af1b92a 100644 --- a/bug/timeline.go +++ b/bug/timeline.go @@ -3,6 +3,7 @@ package bug import ( "strings" + "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/identity" "github.com/MichaelMure/git-bug/util/git" "github.com/MichaelMure/git-bug/util/timestamp" @@ -10,7 +11,7 @@ import ( type TimelineItem interface { // ID return the identifier of the item - ID() string + Id() entity.Id } // CommentHistoryStep hold one version of a message in the history @@ -25,7 +26,7 @@ type CommentHistoryStep struct { // CommentTimelineItem is a TimelineItem that holds a Comment and its edition history type CommentTimelineItem struct { - id string + id entity.Id Author identity.Interface Message string Files []git.Hash @@ -34,7 +35,7 @@ type CommentTimelineItem struct { History []CommentHistoryStep } -func NewCommentTimelineItem(ID string, comment Comment) CommentTimelineItem { +func NewCommentTimelineItem(ID entity.Id, comment Comment) CommentTimelineItem { return CommentTimelineItem{ id: ID, Author: comment.Author, @@ -51,7 +52,7 @@ func NewCommentTimelineItem(ID string, comment Comment) CommentTimelineItem { } } -func (c *CommentTimelineItem) ID() string { +func (c *CommentTimelineItem) Id() entity.Id { return c.id } |