aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operations/create.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-14 22:18:40 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-14 22:18:40 +0200
commitd973718567b0f7a7e775dbab2c557f0dda9afa29 (patch)
tree9cdaa94f72b62de0af65e77015587ad2093b3600 /bug/operations/create.go
parentda470993d13ce63087034db9b7e8ffbdf18e87a5 (diff)
downloadgit-bug-d973718567b0f7a7e775dbab2c557f0dda9afa29.tar.gz
add time to comments
Diffstat (limited to 'bug/operations/create.go')
-rw-r--r--bug/operations/create.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/bug/operations/create.go b/bug/operations/create.go
index 49b648a2..81fc58f1 100644
--- a/bug/operations/create.go
+++ b/bug/operations/create.go
@@ -3,6 +3,7 @@ package operations
import (
"github.com/MichaelMure/git-bug/bug"
"reflect"
+ "time"
)
// CreateOperation define the initial creation of a bug
@@ -14,6 +15,7 @@ type CreateOperation struct {
Title string
Message string
Author bug.Person
+ Time time.Time
}
func NewCreateOp(author bug.Person, title, message string) CreateOperation {
@@ -22,6 +24,7 @@ func NewCreateOp(author bug.Person, title, message string) CreateOperation {
Title: title,
Message: message,
Author: author,
+ Time: time.Now(),
}
}
@@ -37,6 +40,7 @@ func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
{
Message: op.Message,
Author: op.Author,
+ Time: op.Time,
},
}
return snapshot