From ba3281dc9918fa49f10c2a166b5b631a931d2d51 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 18 Jul 2018 00:16:06 +0200 Subject: all operations now have an author and a timestamp --- bug/operations/create.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'bug/operations/create.go') diff --git a/bug/operations/create.go b/bug/operations/create.go index ad1d99ac..72eba843 100644 --- a/bug/operations/create.go +++ b/bug/operations/create.go @@ -2,7 +2,6 @@ package operations import ( "github.com/MichaelMure/git-bug/bug" - "time" ) // CreateOperation define the initial creation of a bug @@ -13,17 +12,13 @@ type CreateOperation struct { bug.OpBase Title string Message string - Author bug.Person - Time int64 } func NewCreateOp(author bug.Person, title, message string) CreateOperation { return CreateOperation{ - OpBase: bug.OpBase{OperationType: bug.CreateOp}, + OpBase: bug.NewOpBase(bug.CreateOp, author), Title: title, Message: message, - Author: author, - Time: time.Now().Unix(), } } @@ -31,9 +26,9 @@ func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { snapshot.Title = op.Title snapshot.Comments = []bug.Comment{ { - Message: op.Message, - Author: op.Author, - Time: op.Time, + Message: op.Message, + Author: op.Author, + UnixTime: op.UnixTime, }, } return snapshot -- cgit