From 67a3752e176790e82a48706236f889cab4f8913d Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 11 Aug 2019 14:08:03 +0200 Subject: bug,entity: use a dedicated type to store IDs --- bug/timeline.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bug/timeline.go') 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 } -- cgit